This following modification will show you how to make a fixed width site that generated by PHPMaker. As we know, PHPMaker by default generates your site which has the width of it by using an approach a hundred percent of your screen width. If you want to limit the maximum width of your site, for example 1040 pixels, then this modification is for you.
Updated: This modification has been tested and works fine also for the latest version, PHPMaker 8.0.3 on August 27, 2011.
All we have to do is customizing PHPMaker template files. In other words, we will not modify the generated script files.
Please click on the following image to watch the demo:
[hidepost]
- Open your Script\template.php file, and find this code:
<!--##=SYSTEMFUNCTIONS.FavIcon##-->
After that line, insert this following code:
<?php // Begin of modification by Masino Sinaga, February 19, 2011 ?> <?php if (@$_GET["export"] == "") { ?> <style> html { height: auto; border-left: 1px solid <?php echo $bordercolor; ?>; border-right: 1px solid <?php echo $bordercolor; ?>; border-top: 1px solid <?php echo $bordercolor; ?>; border-bottom: 1px solid <?php echo $bordercolor; ?>; width: <?php echo (EW_TOTAL_WIDTH); ?>px; display: block; margin-left: auto; margin-right: auto; margin-top: 10px; margin-bottom: auto; } body { background-color: inherit; /* background color */ color: inherit; /* text color */ font-family: tahoma; /* font name */ font-size: 8pt; /* font size */ margin: 0; /* top right bottom left */ width: <?php echo (EW_TOTAL_WIDTH); ?>px; height: auto; display: block; } /* template layout */ .ewLayout { font-family: tahoma; /* font name */ font-size: 8pt; /* font size */ width: <?php echo (EW_TOTAL_WIDTH); ?>px; height: 100%; } .ewContentTable { font-family: tahoma; /* font name */ font-size: 8pt; /* font size */ width: <?php echo (EW_TOTAL_WIDTH); ?>px; height: 100%; clear: left; } .ewMenuColumn { width: <?php echo EW_VERTICAL_MENU_WIDTH; ?>px; } </style> <?php } ?> <?php // End of modification by Masino Sinaga, February 19, 2011 ?>
- Open your \Script\ewcfg.php file, and find this code:
// General
before that line, insert this following code:
// Begin of modification by Masino Sinaga, February 19, 2011 define("EW_SCROLL_TABLE_WIDTH", 890, TRUE); // The width size of the scroll table define("EW_VERTICAL_MENU_WIDTH", 150, TRUE); // Vertical menu width define("EW_TOTAL_WIDTH", EW_SCROLL_TABLE_WIDTH + EW_VERTICAL_MENU_WIDTH + 20, TRUE); // End of modification by Masino Sinaga, February 19, 2011
[/hidepost]
Leave a Reply
You must be logged in to post a comment.