How to hide the Joomla frontpage

 In Joomla

Most Joomla templates show the Joomla Frontpage (the content area) on the first page of your website. However, sometimes you just want a mixup of several modules, without articles to be published directly on your first page.

So, how are we going to prevent that the Joomla frontpage will be shown? It’s not that hard to adjust the template files in such a way that it will be hidden. At a minimum you need access to the template php file, called index.php. You can edit it using the joomla backend. Goto extensions / manage templates, select your template by clicking the name and then click edit html. However, it is more easy to use an ftp client to access the file within in the joomla templates/templatename folder.

Search within the index.php file for the following code:

And replace it with this:
params->get('showfrontpagearticles'); ?>

Most likely the divs are already existing in your template and “content” is probably named something else. That’s all there is to it. This simple change will hide the frontpage from the front page ๐Ÿ™‚

Now we can make things slightly more complicated. Especially when you’re creating your own template for the community or a customer it is useful to let the user of the template decide whether or not to hide the joomla frontpage. To be able to do that we’ll simply add a template parameter. You cannot make this change anymore from the joomla backend. Direct access to the template files is necessary to be able to add the following lines in your templateDetails.xml file:

Add the lines above in the section of the file and save it. Next we need an additional change in our index.php. Find back the part where the component is loaded and now change it to the following:

params->get('showfrontpagearticles'); ?>

Using this code will hide the frontpage at your website’s home depending on the value of the parameter set by the user.

Recommended Posts

Leave a Comment

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Start typing and press Enter to search

Best Joomla templates december 2013