Question

I am trying to create a custom template, but I want the template to look a little different for my Joomla! homepage/frontpage. Is there a easy boolean-type expression I can use to determine whether I am on my site's homepage?

That way, I can just say if ($on_homepage) { [custom homepage html] } else { [regular template] }

Thanks in advance!

Was it helpful?

Solution

This is very easy, just create 2 templates. One for your homepage and one for the rest of your site. Then install both, make sure you give them a descriptive name in their xml file so you know the difference.

Once they are installed you can set a default template that would be site wide. Then choose/click on your homepage template and it's options will load up. On the bottom left you can select the menu items where this template will be visible. This setup is very much like the way in which you define where modules are shown.

OTHER TIPS

You can create a separate template for your homepage. More details here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top