Post by truffles » Sat Mar 26, 2011 3:16 am

Hi, I have a top-level category page on my site where I need to add some custom images AFTER where the sub-category links and their associated pictures are.

The problem is, if I just edit the page in the backend, there doesn't seem to be a way where I can make these custom images appear after the sub-category linksm (because the code for including the sub-category links isn't shown in the page code)

Any ideas how I can get around this?

Many thanks

New member

Posts

Joined
Thu Feb 03, 2011 2:55 am

Post by truffles » Mon Mar 28, 2011 4:13 pm

Anyone know if this can be achieved?

Thanks...

New member

Posts

Joined
Thu Feb 03, 2011 2:55 am

Post by miguel123 » Mon Mar 28, 2011 11:12 pm

You can do it in template file product/category.tpl

if ($category==1){ do something }

Newbie

Posts

Joined
Tue Mar 09, 2010 8:48 pm

Post by truffles » Mon Mar 28, 2011 11:23 pm

Well, I tried this in the product/category.tpl:

Code: Select all

<?php if ($category==42){ ?>
<img src="image/newcategory.jpg" />
<?php } ?>
Don't know if this is right as this is a subcategory (&path=36_42) but either way it doesn't display the image. Any ideas?

It also spawned an error saying that $category variable doesn't exist...

New member

Posts

Joined
Thu Feb 03, 2011 2:55 am

Post by miguel123 » Tue Mar 29, 2011 6:38 pm

Sorry, didn't remember I had customized my cart. If you add this it shoud work:

Code: Select all

$this->data['category'] = $category_id;
to controller/product/category.php around line 44 or so. After these lines anyway

Code: Select all

$category_id = array_pop($parts);
		} else {
			$category_id = 0;
		}

Newbie

Posts

Joined
Tue Mar 09, 2010 8:48 pm
Who is online

Users browsing this forum: No registered users and 21 guests