Using a field value in page title and page header.
How can I use a value from a field in the page title?
For example: table 'Clients' has fields 'id', 'company' and 'country'
One record is: 12, Microsoft, USA
When I view this clients record I want the page title to be:
"Clients View - Microsoft, USA"
Same goes for the Header component on the Page Design of Clients View.
What I've done is this:
I added to Page Events-BeforeView
clear_session("company_name");
//query the database and return a single field value
$db->where("id", $rec_id);
set_session("company_name", $db->getValue("clients", "company"));
and then use get_session("company_name") in the Header component but doesnt work, it shows: get_session("company_name")
and then I used <?php echo get_session("company_name"); ?> in the Header component -- but doesnt work either it just puts <?php echo get_session("company_name"); ?> in HTML.
How can I get show the company name???