If we need ton integrate a module in a template, we add this code in the index.php :

<?php if ($this->countModules('position-4')): ?>
    <jdoc:include type="modules" name="position-4" style="xhtml" />
<?php endif; ?>

But how can we integrate a component ?

I’ve installed a module that appears in the component menu and i don’t see any module position there.

1 Answer 1


The define the area where a component is displayed, you need to add the following somewhere in your template index.php:

<jdoc:include type="component" />

Do bare in mind that this should only be used once

For more information in jdoc include statements, have a read of the following:


Hope this helps

  • Perfect, it works. So in a template, if i need a component on a specific page, i need to link a menu item to the component and add this code in the template with a condition to check the id of the menu item ? Commented Aug 11, 2014 at 10:13
  • No, this is where the dynamic side kicks in. The template index.php is only used to define where you want to display things. If you want a component on a specific page, simply create a new menu item in the Joomla backend and set the type to which ever component you wish to use
    – Lodder
    Commented Aug 11, 2014 at 10:16
  • Yes, i know how to do that. I’m creating a template from scratch and i need a specific design for a component. I was wondering how to integrate it in index.php According to your comment, i only need <jdoc:include type="component" /> once. I think i need to review my template structure. Commented Aug 11, 2014 at 10:23
  • Ahh I see. In this case you should create a Template Override
    – Lodder
    Commented Aug 11, 2014 at 10:29

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.