View Single Post
  #1  
Old 09-28-2004, 09:10 PM
 
coneme coneme is offline
 

Member
  
Join Date: Feb 2004
Posts: 14
 

Default Direct Link to parent category

Just say I have one category:

Intel

and underneath this 'parent' category I have 3 subcategories:

Celeron
Pentium
Pentium Mobile

If a customer is viewing the products listed in the "Pentium" category, but wants to 'jump back' one level to "Intel" - is there a way I can provide such a direct link back to this 'parent' category?

I want to achieve this *without* using the full length breadcrumbs (location.tpl).


I had a stab at this, but the code below produces a link for the *current* category - if somebody knows how to refer to the *2nd* last element of the $location array I think it might do the trick:

Code:
{if !$subcategories} {section name=position loop=$location} {if %position.last% eq "true"} {if $location[position].1 ne "" } <a href="{$location[position].1}">{/if} <font class=NavigationPath>{$location[position].0}</font> {if $location[position].1 ne "" }</a>{/if} {/if} {/section} {/if}
__________________
xcart 3.5.10 [unix]
PHP 4.3.8
MySQL 4.0.20
Reply With Quote