tags:

views:

536

answers:

1

Hi

I'm working on a Joomla site, and I need the front page to look slightly different from the rest of the pages, but not enough to warrant the use of two themes (it's a pain to have to update two stylesheets and two sets of images every time I want to make a small change).

My thoughts are to throw in a little test in the index.php of the template: if we're at the homepage, serve X, otherwise, serve Y. However, I'm not entirely sure how to test this. I can't just use the URL because url.com/ and url.com/index.php and url.com/index.php? etc etc are all valid.

Does anyone know of a way to do what I'm trying to do? Like a $_JOOMLA['page'] variable or something convenient like that?

Thanks! --Mala

+2  A: 
if(JRequest::getVar('view') == "frontpage" ) {
    //You are in!
}
else {
    //You are out!
}
Soufiane Hassou
Thank you! This is exactly what I was looking for.
Mala
jlleblanc
It works if you're using the com_content frontpage view on the front page, and not another component.
Flavio Copes