Page 1 of 1

Something like is_home function

Posted: Thu Apr 29, 2010 3:08 am
by buyparfumes
Is there a "is_home" function like the one in wordpress? - if is on homepage to show something, else to show something other?

Re: Something like is_home function

Posted: Thu Apr 29, 2010 3:23 am
by Qphoria
not quite that easily but you can use:

Code: Select all

if (!isset($this->request->get['route'])) || $this->request->get['route'] = 'common/home') {
    echo  "This is homepage";
}

Re: Something like is_home function

Posted: Fri Apr 30, 2010 12:18 am
by buyparfumes
Where should i paste this? If i paste in the .tpl file it just dont do what it should :(

Re: Something like is_home function

Posted: Fri Apr 30, 2010 10:16 am
by linuxaisle
Here's the correct php:

Code: Select all

if ((!isset($this->request->get['route'])) || ($this->request->get['route'] == 'common/home')) {
    echo  'This is homepage';
}
enjoy

Re: Something like is_home function

Posted: Fri Apr 30, 2010 10:39 am
by Qphoria
Ya.. sorry.. I always forget the == when coding directly into a forum window

Re: Something like is_home function

Posted: Fri Dec 02, 2011 8:38 pm
by innuoluke
Thanks guys :) Just found this through Google and it solved a problem for me quite nicely :)