One of my clients wants to display a message for SEO purposes on each page (menu item) and I know this can be easily solved with several modules of the type "custom html" each one assigned to its corresponding menu item.

But they have a lot of menu items meaning equal number of modules.

I was wondering if there is an easy way to do it and I have two ideas:

1 - Have an extra field in the menu item to add the text and develop a module that read that extra field and render it in the page. I can develop the module but I don´t know how to add an extra field in the menu item form without using overrides. ¿is there a way to do that?

2 - Develop a module that allow you to choose menu item and message in a repeteable form. I can program this but I would like to ask if someone knows of a module that have this fucntion so I can spare the programming (I already search the JED)

Thanks for your help

1 Answer 1


Option 1

A quick way to do this is to install Regular Labs Sourcerer (or similar) and use a Custom HTML module with similar code to the following:

$app = JFactory::getApplication();
$itemid = $app->input->getCmd('Itemid', '');
switch ($itemid)
case '131':
  echo "<p>Message 1</p>";
case '132':
  echo "<p>Message 2</p>";
case '133':
  echo "<p>Message 3</p>";
default :
  echo "<p>Message 4</p>";

Enter menu IDs with the corresponding messages in a switch statement. You could include a default message in case you missed a page.

Option 2

Keywords meta data has little value these days (from an SEO perspective) so you could hijack this field for your own purposes by installing Regular Labs Sourcerer (or similar) and using a Custom HTML module with similar code to the following:

$doc = JFactory::getDocument();
$keywords = $doc->getMetaData('keywords');
if ($keywords) {
  echo "<p>" . $keywords . "</p>";
  $doc->setMetaData('keywords', '');
  • Hi, this is a great solution for me, but my customer should not do any PHP at all. Thanks. Jan 11, 2017 at 15:31
  • OK, I have added an additional option. Jan 11, 2017 at 21:50

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.