I am working with a unique template index.php file and want to remove the
<jdoc:include type="component" /> because I don't want to display the empty space on the home page.
index.php, you can use the following:
<?php $menu = JFactory::getApplication()->getMenu(); ?> <?php if ($menu->getActive() != $menu->getDefault()) : ?> <jdoc:include type="component" /> <?php endif; ?>
All this basically does is check if the active menu item doesn't match the default menu item. If it doesn't, display the component view.
@Lodder Thanks, but I had tried it and it does not work. After different test I found the solution, maybe is not a best practices but this work.
In your index.php
In line 20 before <!DOCTYPE html> <?php $menu = $app->getMenu(); $active = $menu->getActive(); $homeactive = $active->home; ?> In the Body: <?php if ($homeactive != 1) : ?> <jdoc:include type="component" /> <?php endif; ?>