Post by pwood » Fri Aug 29, 2014 2:18 pm

I need to display a different image on top of each category header but can't get to work.

Right now in my category.tpl, I put a code like this between <div class="container"> and <div class="row"> :

Code: Select all

<?php if($menu['href']=="http://mysite.com/index.php?route=product/category&path=60") { ?>
<img src="http://mysite.com/image/data/about_us/2.jpg" width="100%" height="100%" margin="0" padding="0"/>
<?php } else if($menu['href']=="http://mysite.com/index.php?route=product/category&path=59") { ?>
<img src="http://mysite.com/image/data/about_us/1.jpg" width="100%" height="100%" margin="0" padding="0"/>
<?php } ?>
But that doesn't worked.

Any suggestions?

Thank you

Active Member

Posts

Joined
Tue May 07, 2013 7:58 pm

Post by bunny Chinh » Fri Aug 29, 2014 10:17 pm

Hi
I do the following
in category contronller . set $this->data['path'] = $this->request->get['path']

Code: Select all

<?php if($path==60) { ?>
<img src="http://mysite.com/image/data/about_us/2.jpg" width="100%" height="100%" margin="0" padding="0"/>
<?php } else if($path==59) { ?>
<img src="http://mysite.com/image/data/about_us/1.jpg" width="100%" height="100%" margin="0" padding="0"/>
<?php } ?>

Newbie

Posts

Joined
Thu Jun 12, 2014 10:54 am

Post by pwood » Sat Aug 30, 2014 4:14 pm

That worked great!
Thank you bunny chinh!

Active Member

Posts

Joined
Tue May 07, 2013 7:58 pm
Who is online

Users browsing this forum: No registered users and 66 guests