[ic] Reversing the tree order

Ton Verhagen tverhagen at alamerce.nl
Thu Aug 28 19:00:26 EDT 2003


Quoting Richard Lucking <lists at lucking.org> :
>We have been using the modification described in
>  http://www.icdevgroup.org/pipermail/interchange-users/2002-June/022345.html
>to reverse the order that the items in the tree are displayed for the
>"breadcrumb" listing on a catalogue we are developing.
>
>The problem is that we have upgraded to 4.9.8. I went to reapply the
>changes, but the Interpolate.pm doesn't have that code in it any more (that
>I can find!)
>
>Looking round, the nearest match I can see is in Menu.pm - but I can't get
>that working. I tried a few "tweaks", but none worked.
>
>Any suggestions would be much appreciated. I've searched round, and couldn't
>find any mention of this.

Richard,

Things have changed quite a bit this year.

You'd best have a look at: code/SystemTag/tree.coretag
in the directory where you have installed Interchange.

Below are the last 7 lines of the tree.coretag:

#::logDebug("last row");
         } # END ARY
#====> Add patch here
         $opt->{object} = { mv_results => \@rows };
#::logDebug("last ary, results =" . ::uneval(\@rows));
         return labeled_list($opt, $text, $opt->{object});
}
EOR

You could add your patch:
@rows=reverse(@rows) if $opt->{reverse};
at the place indicated.

Or when you are using the tree tag in Perl you could do something like:

$Tag->tree($opt);
# Reverse the results, so the trail starts at the beginning
for( reverse @{$opt->{object}{mv_results}} ) {

... Do some interesting stuff here

}

Doing so you would not need the patch at all.


Good luck !


Best regards,

Ton

--
Alamerce Nederland --- Cornerstone of eBusiness
Phone +31-40-2374381    info at alamerce.nl    http://www.alamerce.nl

eCommerce Solutions -- Consulting -- Website & Interchange Hosting 



More information about the interchange-users mailing list