I need to set the article title as page title. Please, note that my articles are not menu items because my menu is built on a custom module. Please, advise. Thank you.
-
1and what is your current page title? is it other than your article title?– FFrewinCommented Dec 7, 2016 at 10:30
-
my current page title in the articles is the main page title, on all articles– mantonCommented Dec 8, 2016 at 12:12
-
@manton please progress this page to a system-recognized resolution.– mickmackusaCommented Feb 6, 2019 at 21:03
Add a comment
|
2 Answers
You can create a plugin for this event:
onContentPrepare
and code something like:
$doc = JFactory::getDocument();
$doc->setTitle( $article->title);
I can give you a more elaborated code if you needed.
-
1Yes, I 'd be grateful if you did, because I am not an expert on coding. Where should I place that code? Thank you very much for your interest.– mantonCommented Dec 8, 2016 at 12:14
-
You can change the page title in Backend Global Configuration. The URL is
/administrator/index.php?option=com_config
if you want to define the separator check: Where can I configure the page title separator from "-" to "|"?