Show only some levels in a breadcrumb?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
xmas3
Forum Members
Forum Members
Posts: 41
Joined: Sat Jul 28, 2007 9:22 am
Location: Bratislava / Slovakia

Show only some levels in a breadcrumb?

Post 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
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm
Location: Marlow, UK

Re: Show only some levels in a breadcrumb?

Post 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.
xmas3
Forum Members
Forum Members
Posts: 41
Joined: Sat Jul 28, 2007 9:22 am
Location: Bratislava / Slovakia

Re: Show only some levels in a breadcrumb?

Post by xmas3 »

yes, I got the same idea. maybe I will try to implement it like a parameter. Thanks, bye. Miro
Post Reply

Return to “Developers Discussion”