Breadcrumb when no record number in URL

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 8, 2012   (RSS)

Re: [theclicklab] Breadcrumb when no record number in URL

By Jason - January 8, 2012

Hi,

You could try to use $selectedCategory instead of getting the number from the Url:

<div class="breadcrumb">
<a href="/">Home</a>
<?php foreach ( $breadcrumbRecords as $breadcrumb ): ?> &rsaquo;
<?php if ( $breadcrumb['num'] != @$selectedCategory['num'] ): ?><a href="/<?php echo strtolower($breadcrumb['url']); ?>/"><?php endif ?>

<?php echo $breadcrumb['name']; ?>

<?php if ( $breadcrumb['num'] != @$selectedCategory['num'] ): ?></a><?php endif ?>
<?php endforeach ?>
</div>


However, in order for this to work, you'll need to either have a number in the Url, or you have to set selectedCategoryNum in your getCategories call.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/