Change single page header title via controller or in template
Permalink
Hi,
I am designing a dashboard single page. And as I noticed the header text (the text in grey are and next to bookmark icon: header.ccm-dashboard-page-header) is automatically set equal to the page title.
Is there a way to change this title? Maybe with setting a variable or even adding something in the template file?
I am designing a dashboard single page. And as I noticed the header text (the text in grey are and next to bookmark icon: header.ccm-dashboard-page-header) is automatically set equal to the page title.
Is there a way to change this title? Maybe with setting a variable or even adding something in the template file?
In your single page's controller, in the view() function you add
Thank you mnakalay.
While we are at it, how can I get the current set $pageTitle? I tried
$this->get('pageTitle');
And it doesn't seem to work.
While we are at it, how can I get the current set $pageTitle? I tried
$this->get('pageTitle');
And it doesn't seem to work.
No that wouldn't work. What happens is you get to set pageTitle in your page's controller and only later does Concrete5 check if you did or not. If not, it uses the page's name.
So basically, if you want to know what Title C5 would use if you didn't set it yourself, you do
$this->c is already set in the controller
So basically, if you want to know what Title C5 would use if you didn't set it yourself, you do
$pageTitle = $this->c->getCollectionName();
$this->c is already set in the controller