Post by buyparfumes » Thu Apr 29, 2010 3:08 am

Is there a "is_home" function like the one in wordpress? - if is on homepage to show something, else to show something other?

парфюми на ниски цени от качествена парфюмерия | филми - всички известни филми | играй игри за деца и големи


New member

Posts

Joined
Sun Jan 24, 2010 4:20 am

Post by Qphoria » Thu Apr 29, 2010 3:23 am

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";
}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by buyparfumes » Fri Apr 30, 2010 12:18 am

Where should i paste this? If i paste in the .tpl file it just dont do what it should :(

парфюми на ниски цени от качествена парфюмерия | филми - всички известни филми | играй игри за деца и големи


New member

Posts

Joined
Sun Jan 24, 2010 4:20 am

Post by linuxaisle » Fri Apr 30, 2010 10:16 am

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

OpenCart user since 4/27/10


New member

Posts

Joined
Wed Apr 28, 2010 2:01 pm

Post by Qphoria » Fri Apr 30, 2010 10:39 am

Ya.. sorry.. I always forget the == when coding directly into a forum window

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by innuoluke » Fri Dec 02, 2011 8:38 pm

Thanks guys :) Just found this through Google and it solved a problem for me quite nicely :)

Web developer for Cotswold Web Services / Innuo Ltd
Need help with your Opencart website? Give us a call to see how we can help.


Newbie

Posts

Joined
Sat Jun 18, 2011 4:36 pm
Who is online

Users browsing this forum: No registered users and 83 guests