Page 1 of 1

Show only some levels in a breadcrumb?

Posted: Wed Jun 18, 2008 7:07 am
by xmas3
Hi all,
what Iam trying to do is to write a small script/condition, that will show only first 2 or 3 levels in a pathway/breadcrumb, cause from that point the pathway is too long . Do you have some ideas how to do it?

Thanks a lot, by
Miro, Slovakia

Re: Show only some levels in a breadcrumb?

Posted: Wed Jun 18, 2008 10:15 am
by scooper
Well a really quick nasty way to do it is to just to change function.breadcrumbs.php (in the plugins directory) to just loop through 2 or 3 interations rather than show the whole path.

So, at about line 113 where you have

Code: Select all

	
		# now create the trail (by iterating through the path we built, backwards)
		for ($i=count($path)-1; $i>=0; $i--) {
you could change the value in the for loop so that it just does 2 items

Code: Select all

		for ($i=count($path)-1; $i>=count($path)-2; $i--) {
or however many you want to show.

Re: Show only some levels in a breadcrumb?

Posted: Wed Jun 18, 2008 12:31 pm
by xmas3
yes, I got the same idea. maybe I will try to implement it like a parameter. Thanks, bye. Miro