1

Can anyone help me how to change the structure of Joomla browser title page? I couldn't find the code structure.

As we all know that whatever info we put in the Menu "Page display" tab "Browser page title", it will always show the following format in the url.

(site name) - (browser page title info written in their respective menu) eg. abcnews - home page information

Now I want to change the above info in the following format:

eg. home page information | abcnews

Now how I am going to do it? How I am going the change the structure? If I know the file where this code is coming from then I can do it. So need help on this.

2

Firstly, for completeness, the position and display of the site title can be manipulated in the global configuration. But this only allows for three options: show before, show after, don't show.

For programmatic manipulation of the page title, you can get and set the JDocument object's property 'title'.

Hence with a system plugin you can do the following:

class plgSystemRandomname extends JPlugin {

    public function onBeforeCompileHead() {

        $app = JFactory::getApplication();

        // Only manipulate the title if this is the Frontend
        if(!$app->isClient('site')){
            return;
        }

        $document = JFactory::getDocument();

        $original = $document->title;

        // Do what ever you like

        $document->title = $new_title;

    }
}
  • Also have a look at route 66 which helps with URL structures – Eoin Aug 2 '18 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.