Change the breadcrumbs separator

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 8, 2013   (RSS)

By aev - December 5, 2013

Another breadcrumb related question:

Can we make the breadcrumb clickable?

Home : Products : Product-1

For the breadcrumb above we would like to have three individual links; "Home", "Products" and "Product-1".  The last one "Product-1" may be redundant as the user would most likely be on that page :)

-aev-

By Dave - December 8, 2013

Hi aev, 

A very simple way would be to just split on : and then print out the crumbs individually.  Such as: 

  $str = "hello : world : there";
  foreach (preg_split("/\s*:\s*/", $str) as $fragment) {
    print " -- <a href='?go=$fragment'>$fragment</a> ---";
  }
  exit;

But for creating our own more advanced custom breadcrumbs you can actually just call getCategories() again with this option: 

'categoryFormat'        => 'showall', // options: showall, onelevel, twolevel, breadcrumb

And it will output just the category nodes that make up the breakcrumb.  You can call showme($categoryRecords) on the result to see the fields it makes available.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com