A navigation chain is the design element which aims to helps users navigate through the site. Navigation chain clearly shows the nesting depth of the current site section:
A common navigation chain includes site section titles with appropriate links applied to them. A site section title is defined in the service file .section.php, which can be found in the corresponding section. The following variables can be used in this file:
The following is an example of the .section.php file.
<? $sSectionName = "Company profile"; $sChainTemplate = $_SERVER["DOCUMENT_ROOT"]."/en/about/chain_template.php"; ?>
You can assign a title to the site section using the visual editor of the Site Explorer module. To do so, go to
In addition to the automatically displayed section titles, you can add arbitrary items to the navigation chain by calling CMain::AddChainItem.
Navigation chain is usually displayed in the prologue visual section by calling the method CMain::ShowNavChain using the delay function technology.
Design of navigation chain is described in a special PHP file - navigation chain template. You can specify the path to this file explicitly when displaying the navigation chain. If the path is not specified, the following algorithm is used to locate the template file.
If, after building a chain, the template path is still not defined, the following file is checked:
If the file exists, its path is used as the menu template path. Otherwise, the default file path is used:
When displaying the navigation chain, the navigation chain template is included every time an item is added. It follows that its main task is to provide the design of a single chain item.
The following are the main variables used in the navigation chain template.
In addition, the following variables are available in the template.
<? // simplest template displaying the standard chain // HTML code displayed before chain $sChainProlog = ""; // HTML code defining the design of a chain item $sChainBody = ""; if (strlen($LINK)>0) $sChainBody .= "<a href=\"".$link."\" class='chainitem'>".$TITLE."</a>"; else $sChainBody .= "<font class='chainitem'>".$TITLE."</font>"; // HTML code displayed after the navigation chain $sChainEpilog = ""; ?>
<? // template displaying the inverted navigation chain without links // can be used in the <title> tag // for better indexing by search engines $sChainEpilog = ""; // if array is defined... if (is_array($arCHAIN)) { // iterate on items reset($arCHAIN); foreach($arCHAIN as $item) { // if first item... if (strlen($sChainEpilog)<=0) $sChainEpilog = $item["TITLE"]; else // otherwise $sChainEpilog = $item["TITLE"]." :: ".$sChainEpilog; } } ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |