jacmaes
11/15/2011 - 8:44 AM

This is a general way to create breadcrumbs for ProcessWire pages. It retreives in an array all the parents and will walk through the array

This is a general way to create breadcrumbs for ProcessWire pages. It retreives in an array all the parents and will walk through the array to display the title and URL of the parents. The last echo returns the title of the current page, without a link.

<?
/*Breadcrumbs
=====================
This is a general way to create breadcrumbs for ProcessWire pages.
It retreives in an array all the parents and will walk through the array to display the title and URL of the parents.
The last echo returns the title of the current page, without a link.
=====================*/
?>

<div id="breadcrumbs">
	<ul>
		<?php 
			foreach($page->parents as $parent) {
				echo "<li><a href='{$parent->url}'>{$parent->title}</a> &raquo;</li>";
			} 
			echo "<li>{$page->title}</li>";
			?>
	</ul>
</div>