Views: 4501
Last Modified: 10.10.2012

A template that is used to display the navigation chain is defined in the file /bitrix/templates//chain_template.php for each site template individually. The structure of a navigation chain template is similar to that of a menu template. The template includes:

  • a header;
  • a body element;
  • a footer parts.

Body element defines a template used to display a single element. The whole chain is built in a loop. Sample navigation chain template:

<?
//--- Chain header
$sChainProlog="";

//--- Body element 
 $sChainBody = "";
//--- The variable $ITEM_INDEX contains the current element number.
if($ITEM_INDEX > 0)
$sChainBody = "  » ";
$sChainBody .= "<a href="".$LINK."" class="smalltext">".htmlspecialchars($TITLE)."</a>";


//--- Footer
$sChainEpilog="";
?>

You can quickly switch to editing the navigation chain template while in the editable area display mode.



You can set the individual navigation chain template for a separate site section. To do so, define a variable $sChainTemplate in the file .section.php and assign it a string value containing the full path to the navigation chain template. For example:

$sChainTemplate = "/bitrix/templates/demo/chain_template.php"

The navigation chain template also can be specified as one of parameters of the function ShowNavChain().

$APPLICATION->ShowNavChain("/bitrix/templates/.default/chain_template_bottom.php")


Courses developed by Bitrix24