I think this is one of the common problem you’ll face while you’re working for the website of Joomla because the component always displays at one position. If there is nothing to display on page, it still be there because of this page layout messy and mostly it’s happened with the homepage because mostly we have different layout on homepage and we don’t want to go with component.
Well, I have solution of problem you face with component display so let’s see the steps to handle component display
Step 1: Create a new module and position of module is frontcomp:
Place below line of code into the index file of template you are using for the website.
Step 2: Next is to replace the below code with display component to:
1 2 3 4 5 6 | <?php if(!$this->countModules('frontcomp')) : ?> <jdoc:include type="message" /> <jdoc:include type="component" /> <?php endif; ?> |
Step3: Create Custom Module
Create a one new custom HTML module and the position of the module is front comps, and select home page only to display.
That’s it.Now, On the homepage of your site will not display component.
Thanks for reading and feel free to share your thoughts, don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.