I want to show Form or Report Name as Title of ChromeTab.Is it possible through PHPMaker generated scripts ?
Simply Put this in the Client Scripts->Global-> Startup script, this will display the page title based on the Table Name in your project.$(document).ready(function() {
var title = $(‘.m-0’).text();
document.title = title;
});
Server side,Language_Load() {
$this->setProjectPhrase(“BodyTitle”, $this->TablePhrase(CurrentPage()->TableName,“TblCaption”) . " - " . $this->ProjectPhrase(“BodyTitle”)); // v2018 code
}This will append table name into project name, return: TableName - ProjectNameNote that Custom File has no CurrentPage()->TableName. You need to write different route for Custom File.
@dsinghThis is not working in PHPM2017 and 18.
i am using the older version. Any change recommended in the code ?
For v2017, simply change this code:
var title = $(‘.m-0’).text();to:
var title = $(‘h4.ewSiteTitle’).text();
@mobharNo effect as yet.
//For v2017, simply change this code:
//var title = $(‘.m-0’).text();//to:
//var title = $(‘h4.ewSiteTitle’).text();
dsingh wrote:
Simply Put this in the Client Scripts->Global-> Startup script, this will
display the page title based on the Table Name in your project.$(document).ready(function() {
var title = $(‘.m-0’).text();
document.title = title;
});I have Tested the same on v2019 and its working.
Try:
var title = $(‘.ewSiteTitle’).text();
@mobhar.All failed for Version 2017. But if we use like:$(document).ready(function() {
var title = ‘Employees List’;
document.title = title;
});Means hard code each page, then it is working.Please any suggestion for change it globally ?
Try:
var title = “<?php echo Language()->TablePhrase(CurrentPage()->TableName, "TblCaption"); ?>”;
Last code was the best for multi-language. It works in v2020 but not in v2021v2021 Client Script and Startup Script doesn’t allow to wrap js code in <?php ... ?>
Is it possible to avoid it?
For PHPMaker v2021, it is similar to: http://hkvforums.com/viewtopic.php?f=18&t=49956