Webdongle wrote: ↑Mon Aug 16, 2021 9:07 am
The Browser Page Title can be defined in globally in global config or individually in a Menu Items 'Browser Page Title' field.
Hi,
Thank you for your reply.
Could you please give more details on this?
Here is what I do: I create an article (article id=3) without menu (I did try to create a hidden menu for this article, same error). This article is to show dynamic content. In .htaccess I do following re-write:
Code: Select all
Rewriterule ^directory/(.*).htm /index.php?option=com_content&view=article&id=3&q=$1 [NC,L]
With that I can create URLs like
https://www.mydomain.com/directory/xyz.htm
https://www.mydomain.com/directory/abc.htm
https://www.mydomain.com/directory/123.htm
All above URLs will go to that article, then I get the "q" string (in the above examples, I will get xyz, abc, 123, etc), and create dynamic content. I then need to set the related title, such as "xyz...", "abc...", "123...", etc.
To set the title, I do
Code: Select all
<?php
$document = JFactory::getDocument();
$document->setTitle( "My Page Title" );
$input = $_GET[ 'q' ];
// create dynamic content here
?>
However, $document->setTitle( ... ) is overridden later by components/com_content/views/article/view.html.php at line 288. So all dynamic URLs have the same browser title, which is the initial title when I create the article.