Now it's time to customize the Page Title style in websites that generated with PHPMaker. Page Title that we are talking about here is the title of page content that located above the main table or main content in your generated pages. We are going to customize PHPMaker template file for this purpose, so we don't have to modify the generated pages.
In addition, we will add the new style to Page Title by adding the outbox line around it, including the background color of its box. Actually, we will override the existing style with our own new style. So this will make your Page Title become more eye-catching, especially when your users visit the certain web page in your web application, they will get the idea quickly about the main content of the current page by seeing the better looking of Page Title.
Updated on May 29, 2012: This customization has been implemented in PHPMaker version 9.0.2, it matches to each other, and as a result, it works properly.
Updated on July 21, 2012: This customization has been implemented in PHPMaker version 9.0.3, it matches to each other, and as a result, it works properly.
Updated on September 4, 2012: This customization has been implemented in PHPMaker version 9.0.4, it matches to each other, and as a result, it works properly.
Updated on November 27, 2012: This customization has been implemented in PHPMaker version 9.1.0, it matches to each other, and as a result, it works properly.
Updated on February 9, 2013: This customization has been implemented in PHPMaker version 9.2.0, it matches to each other, and as a result, it works properly.
Updated on June 17, 2013: This customization below has been handled by using MasinoFixedWidthSite extension. You don’t need to implement the customization below if you use my extensions together with the original PHPMaker Template and Extension files.
[hidepost]
-
First of all, we will add our new style to the .css file that will be generated by PHPMaker. To do this, from your PHPMaker application, go to HTML tab, then click on Styles sub-tab, and then click on Edit Styles button. You will see a CSS Editor window afterwards. Scroll down to the bottom of that textbox, and find for this code:
/*END_USER_STYLES*/
before that line, please insert the following code:
/* Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 */ .ewTitle{ background-color: #EEEEEE; color: #000000; padding: 0.5em; border-left: 1px solid #CACACA; border-right: 1px solid #CACACA; border-top: 1px solid #CACACA; border-bottom: 1px solid #CACACA; text-align: left; font-family: verdana; /* font name */ font-size: 9pt; /* font size */ font-weight: bold; display: block; vertical-align:top; } /* End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 */ -
Next step, we are going to remove (for this moment) the global Site Title that currently located above the Page Title. Actually this should be located in the header. We are going to customize it later in the separate article.
Open your \Script\template.php file, and find this code (PHPMaker version <= 9.0.1): [code lang="php"]ProjectPhrase("BodyTitle") ?>
[/code]
or if you are using PHPMaker version >= 9.0.2, then find this code:
<p><span class="ewSiteTitle"><?php echo $Language->ProjectPhrase("BodyTitle") ?></span></p>then just remove that code from that file. Don't worry, we will put it in the header in the separate article later. We just don't want to see the Site Title since it uses the default style which same that the Page Title uses. If we don't remove it, users will get confused to see two Title in the same page area.
-
Open your \Script\list-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
->TableCaption() ?>
->ExportOptions->Render("body"); ?>[/code]
and if you are using PHPMaker version >= 9.0.2, then find this code:
<p><span class="ewTitle ewMasterTableTitle"><!--##@MasterRecord##--><?php echo $<!--##=sMasterTblVar##-->->TableCaption() ?> </span><?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> </p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@MasterRecord##--><?php echo $<!--##=sMasterTblVar##-->->TableCaption() ?> <?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> </span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Still in the \Script\list-script.php file, then find again this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
->CurrentMode == "add" || $->CurrentMode == "copy") { ?>->CurrentMode == "edit") { ?> Phrase("") ?>->TableCaption() ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
->CurrentMode == "add" || $->CurrentMode == "copy") { ?>->CurrentMode == "edit") { ?> Phrase("") ?>->TableCaption() ?>
[/code]
or if you are using PHPMaker >= 9.1.0, then find this code:
<p style="white-space: nowrap;"><span id="ewPageCaption" class="ewTitle ewTableTitle"><?php if ($<!--##=gsTblVar##-->->CurrentMode == "add" || $<!--##=gsTblVar##-->->CurrentMode == "copy") { ?><!--##@Add##--><?php } elseif ($<!--##=gsTblVar##-->->CurrentMode == "edit") { ?><!--##@Edit##--><?php } ?> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span></p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle" style="white-space: nowrap;"><?php if ($<!--##=gsTblVar##-->->CurrentMode == "add" || $<!--##=gsTblVar##-->->CurrentMode == "copy") { ?><!--##@Add##--><?php } elseif ($<!--##=gsTblVar##-->->CurrentMode == "edit") { ?><!--##@Edit##--><?php } ?> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Still in the \Script\list-script.php file, find again this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
->getCurrentMasterTable() == "") { ?>
->ExportOptions->Render("body"); ?>
->ExportOptions->Render("body"); ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?>
->getCurrentMasterTable() == "") { ?>
->ExportOptions->Render("body"); ?>
->ExportOptions->Render("body"); ?>
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p style="white-space: nowrap;"><span id="ewPageCaption" class="ewTitle ewTableTitle"><?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?> </span> <!--## if (nMasterTableCount > 0) { ##--> <?php if ($<!--##=gsTblVar##-->->getCurrentMasterTable() == "") { ?> <?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> <?php } ?> <!--## } else { ##--> <?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> <!--## } ##--> <!--## } ##--> </p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle" style="white-space: nowrap;"><?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?> <!--## if (nMasterTableCount > 0) { ##--> <?php if ($<!--##=gsTblVar##-->->getCurrentMasterTable() == "") { ?> <?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> <?php } ?> <!--## } else { ##--> <?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> <!--## } ##--> <!--## } ##--> </span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\add-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><!--##@Add##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span></p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@Add##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\edit-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><!--##@Edit##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span></p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@Edit##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\view-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
->ExportOptions->Render("body"); ?>[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?> ->ExportOptions->Render("body"); ?>
[/code]or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><!--##@View##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?> </span><?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> </p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@View##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?> <?php $<!--##=sPageObj##-->->ExportOptions->Render("body"); ?> </span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\delete-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><!--##@Delete##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span></p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@Delete##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\search-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><!--##@Search##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span></p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@Search##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\update-script.php file, and find this code (for PHPMaker version <= 9.0.1):
[code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
and if you are using PHPMaker version >= 9.0.2 and version < 9.1.0, then find this code: [code lang="php"]
Phrase("") ?>->TableCaption() ?>
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><!--##@Update##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span></p>then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@Update##--> <?php echo $Language->Phrase("<!--##="TblType" + TABLE.TblType##-->") ?><?php echo $<!--##=gsTblVar##-->->TableCaption() ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> -
Open your \Script\userpriv.php file, and find this code for PHPMaker < 9.1.0:
[code lang="php"]
[/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewUserLevelPermissionTitle"><!--##@UserLevelPermission##--></span></p>
then replace it with the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@UserLevelPermission##--></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?>
-
Open your \Script\changepwd.php file, and find this code for PHPMaker version < 9.1.0:
[code lang="php"]
[/code]before that line, please insert the following code:
<div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@ChangePwdPage##--></span> </div>
or if you are using PHPMaker version >= 9.1.0, then find this code:
<p><span id="ewPageCaption" class="ewTitle ewChangePasswordTitle"><!--##@ChangePwdPage##--></span></p>
then replace it with the following code for PHPMaker version >= 9.1.0:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"><!--##@ChangePwdPage##--></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?>
-
Now we also are going to add Page Title in the blank page. To do this, open \Script\blankpage.php file, and find this code:
<!--##include phpcommon.php/phpcommon-message##-->
before that line, please insert the following code:
<?php // Begin of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?> <div id="ewContainer"> <span class="phpmaker ewTitle"> <?php echo "Your Title Here"; ?></span> </div> <?php // End of modification Customize Page Title Style, by Masino Sinaga, May 1, 2012 ?>
- Finally, re-generate your script files using PHPMaker as always.
[/hidepost]
This did not work for me on 9.04. Failed on re-generating when building the list file for the first table.
Make sure you have followed all the steps above carefully, as I did not get any trouble while generating the script files after modifying it. Just for your information, I have tested it for 9.0.2, 9.0.3, and 9.0.4 and all of them are succeeded.