Breadcrumbs for the Products module

  Previous article Next article  

Breadcrumbs for the Products module

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 1.11.13
  Last updated: 22-11-2017
  Comments: 0
  http://cms.ms/D8Jv

There isn't one method for adding a breadcrumb trail to the Products module for CMS Made Simple™.
Climbing down the 'hierarchy ladder' to the product, you pass three templates and each template has its own method.


Example:
[+] Hierarchy 1 (Hierarchy template)
   [+] Hierarchy 1.1 (Hierarchy template)
     [+] Hierarchy 1.1.1 (Summary template)
       [ - ] Product (Detail template)

  How to use

Add to the Products module templates:

Hierarchy template
<div class="products_breadcrumbs">
  {products_hierarchy_breadcrumb hierarchyid=$hierarchy_item.parent_id|default:'' assign=tmp}
  <a href="{root_url}">Home</a> &raquo; {if $tmp != ''}{$tmp} &raquo; {/if}{$hierarchy_item.name|default:''}
</div>
Summary template
<div class="products_breadcrumbs">
  {products_hierarchy_parent hierarchyid=$actionparams.hierarchyid assign=tmp}
  {products_hierarchy_breadcrumb hierarchyid=$tmp assign=tmp2}
  {$hierarchy_info = $Products->GetHierarchyInfo($active_hierarchy)}
  <a href="{root_url}">Home</a> &raquo; {if $tmp2 != ''}{$tmp2} &raquo; {/if}{$hierarchy_info.name}
</div>
Detail template
<div class="products_breadcrumbs">
  <a href="{root_url}">Home</a> &raquo; {$entry->breadcrumb} &raquo; {$entry->product_name}
</div>





CMS Made Simple 2.2.5 - Tutorials, tips and tricks - CMSMS 2.2.5

Breadcrumbs for the Products module

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 1.11.13
  Last updated: 22-11-2017
  Comments: 0
  http://cms.ms/D8Jv