Breadcrumb when no record number in URL

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

By theclicklab - January 7, 2012

Hi there,

I'm having an issue getting a breadcrumb working - I think its due to the fact that I don't have the record number in the url?

Page URL's are formatted as: www.xyz.com/abc/

Here's the code:

// load breadcrumbs
list($breadcrumbRecords, $selectedCategory) = getCategories(array(
'tableName' => 'pages', // REQUIRED
'categoryFormat' => 'breadcrumb', // showall, onelevel, twolevel, breadcrumb
));

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


Any suggestions?

Many thanks