Is It Possible To Add Module In PHP File?

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
1 year 7 months ago #350958

Hi there,

I'm trying to include a module in product_show_default.php using {loadmoduleid 132}, but it doesn't work. Am I doing something wrong or it's not possible?

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 7 months ago #350961

Hi,

This is a content tag. The content plugin which will replace the tag by the actual module is only triggered when Joomla displays content. So if you want it to be replaced, you need to tell Joomla that it is in a content.
For example, like this:

<?php echo JHTML::_('content.prepare', '{loadmoduleid 132}'); ?>

Otherwise, if you want to be able to add modules anywhere on your website with tags without having to use PHP to make them as "content", you need to use the plugin Modules Anywhere:
extensions.joomla.org/extension/modules-anywhere/

Please Log in or Create an account to join the conversation.

  • Posts: 964
  • Thank you received: 11
  • Hikashop Business
1 year 7 months ago #350976

Thank you :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum