User Tools

Site Tools


en:public:developer:template_system:tags:navigation:tbreadcrumbs:create

<#TBreadcrumbs.create>

This tag permit to construct a Breadcrumbs. It is a navigation aid used in user interfaces, it allows users to keep track of their locations within programs or documents. The term comes from the trail of breadcrumbs left by Hansel and Gretel in the popular fairytale.

Parameters

Name Mandatory Default Description
Template No If not empty then Parse this template with the new created tbreadcrumbs object, return the result and free the object

cfgpages configuration

The breadcrumps is build like an hierarchical site structures (the parent pages of the current one). this hierarchical site structures is taken from the cfgpages. if for exemple the cfgpages contain the nodes

  <page name='/'>
    <page name='real-estate'>  
      <page name='residential'>  
        <page name='holiday-rentals' />
      </page>
    </page>
  </page>

then the breadcrumps on the page /real-estate/residential/holiday-rentals/ will be “Home > Real Estate > Residential > Holiday rentals”

Each <page> nodes in the cfgpages xml file must also contains in their <cfg> child node one <breadcrumbs> node that contain the neccessary params to build the breadcrumps

<page name="...">
  <cfg>
    ...
    <breadcrumbs>
      <visible>1</visible>
      <expand_geoplace>1</expand_geoplace>
      <title>REAL ESTATE</title>
    </breadcrumbs>
    <title>Real Estate</title>
    ... 
  </cfg>
</page>  
  • <visible> - 1 or 0 (default): used to say if the current node must be show in the Breadcrumps
  • <expand_geoplace> - 1 or 0 (default): Insert after the current node the geo place items (ie: > United States > Illinois > Cook > Chicago > Near North Side in our exemple)
  • <title> - Used for the title of the current node. by default it's taken from cfg.breadcrumbs.title and if empty them from cfg.title

Example

<#{breadcrumbs>
  <#{template>
    <#{htmlbox template="box_14_2.html">
 
      <#{box_title><#page_title xmlencode=1><#}box_title>
 
      <#{box_content>
        <#for var="i" from="0" to="<#breadcrumbs.count> - 1">
          <#if condition="(<#i> >= 1)">&gt;<#endif>
          <#if condition="(<#i> < <#breadcrumbs.count> - 1)"><a href="<#breadcrumbs[<#i>].url xmlencode=1>"><#endif>
            <#breadcrumbs[<#i>].title xmlencode=1>
          <#if condition="(<#i> < <#breadcrumbs.count> - 1)"></a><#endif>
        <#Endfor>
      <#}box_content>
 
    <#}htmlbox>
 
  <#}template>
 
<#}breadcrumbs>
en/public/developer/template_system/tags/navigation/tbreadcrumbs/create.txt · Last modified: 2013/05/19 14:35 by svanderclock