Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[Solved] HTML Title for the CustomPage Plugin
mclovin
New
Anyone knows how to override the HTML page title for a custom page created by the custom page plugin?
0
Best Answers
-
Todd Vanilla StaffI'm not 100% familiar with the plugin, but the following should work if you put it in the custom page php file:
$this->SetData('Title', 'Foo');
or$this->Head->Title('Foo')
Those both do something slightly different, so try them both out and see what you like.1 -
Todd Vanilla StaffOh okay, I think Gdn::Controller() may be in the current release then. Just try
$this->SetData('Title', 'Foo')
.2
Answers
Here is what the custom plugin code looks like: Then on the default.php which is a custom page, I dont think I can do:
Gdn:Controller()->Head->Title('Foo')
$this
in the view.I tried
<?php Gdn::Controller()->SetData('Title', 'Foo'); ?>
or
<?php Gdn:Controller()->Head->Title('Foo')?>
It says:
Fatal error: Call to undefined method Gdn::controller() in ......
$this->SetData('Title', 'Foo')
.