[ic] BreadCrumb Trail - Interpolate.pm Code, Tree Code

Jonathan Clark interchange-users@icdevgroup.org
Mon Jun 24 09:12:00 2002


> Thanks, Jonathan
>
> I plugged in the line in Interpolate.pm as you mentioned:
>
>   @rows=reverse(@rows) if $opt->{reverse};
>   return labeled_list($opt, $text, {mv_results => \@rows});
>
> However, there is a prob.
>
> What I want to do is display the Breadcrumb trail as:
>
> Home >> Cat 1 >> Subcat >> subsub >> etc...
>
> That's the purpose of the reverse code.
>
> But, I also want to display the Tree in it's correct manner:
>
> Cat 1
>   Subcat 1
>   Subcat 2
>   Subcat 3
>     subsub1
>
> The problem is that the reverse code above reverses the order of the subs in the tree, as well:
>
>   Subcat 3
>   Subcat 2
>   Subcat 1
> Cat 1
>
> What I thought is that perhaps I could create a breadcrumb_sub in Interpolate.pm to use for just the Breadcrumb trail.
> This way, the Tree sub can operate normally.

When I first thought about creating the 'breadcrumb trail' I thought about creating a new sub. When I started this I realised that
it is just the same tree but walked backwards and can be accomplished by reversing the parent-child relationship in the tree tag.
You just need to tell the [tree] tag to start at the end and it all works.

In your above output you still have the master and subordinate the way round you would for a category list - you need to swap these
around.

Trust me - I have this working.

good luck,

Jonathan.