0

I am trying to use a module in a template to reflect the current menu or article title and need help with the PHP code to insert it in the module.

It basically should be the article title on all articles and the menu title for non-article pages that have menu items.

It sits above the maincontent wrapper in the template.

I am using Joomla 4.4 and can insert php code into my modules directly with the page builder I have or via Sourcerer.

1

1 Answer 1

0

To get the page title as displayed in the browser:

$app->getDocument()->getTitle();

To get the "page heading":

$app->getParams()->get('page_heading');

There is also the "page title" parameter but it seems to be the same as page heading. Implementation may differ by component though.

$app->getParams()->get('page_title');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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