Cyclone3 Skin

210-page tree.lite.mdl

From Cyclone3 Wiki

Displays tree or list of sitemap nodes.

Contents

Input parameters

ID

  • description: ID of root node
  • format: Sitemap page ID
  • default: 0

tree

  • description: Switch to tree/flat list output sitemap
  • format: 1/0
  • default: 1

level

  • description: Level to display items from
  • format: -n/n
  • default: 0

parent

  • description: Display root level parent
  • format: 0/1
  • default: 0

check_sub

  • description: If true, checks if root node has subitems, if not - replaces the default template with TMP.empty, if it exists
  • format: 0/1
  • default: 0

db_order

  • description: Order of loaded items
  • format: 0/1
  • default: ID_charindex

depth

  • description: How many sublevels should be fetched
  • format: number
  • default: 0

current_ID

  • description: Current sitemap node, used for highlighting items
  • format: number
  • default: 0

Output templates

Default output

  • definition: TMP
  • description: mandatory
  • example:
<DEFINITION id="TMP">
 <div class="menu">
<#tree#>
 </div>
</DEFINITION>
Replaced variables
<%db_ID%> Sitemap node ID
<%db_ID_entity%> Sitemap node ID_entity
<%db_ID_parent%> Sitemap node parent ID
<%db_name%> Sitemap node name
<%db_name_url%> Sitemap node name in url format
<%db_path%> Sitemap node path from root
<%db_level%> Sitemap node level

Default item output

  • definition: item
  • description: mandatory. default item template
  • example:
<DEFINITION id="item">
  <li>
   <a href="?|?a210_path=<%path%>" alt="<%name%>"><%name%></a>
 <#tree#>
  </li>
 <#item#>
 </DEFINITION>
Replaced variables
<#tree#> Placeholder for the current item's submenu
<#item#> Placeholder for the following item. If it doesn't exist, only the first item will be inserted into the main template and further items won't be.
<%ID%> Sitemap node ID
<%ID_entity%> Sitemap node ID_entity
<%ID_parent%> Sitemap node parent ID
<%name%> Sitemap node name
<%name_url%> Sitemap node name in url format
<%path%> Sitemap node path from root
<%level%> Sitemap node level

Highlighted item output

  • definition: item.current
  • description: template for current item and parent items of the current item
  • example:
<DEFINITION id="item.current">
 <li class="active">
  <a href="?|?a210_path=<%path%>" alt="<%path%>"><%name%></a>
<#tree#>
 </li>
<#item#>
</DEFINITION>
Replaced variables
<#tree#> Placeholder for the current item's submenu
<#item#> Placeholder for the following item. If it doesn't exist, only the first item will be inserted into the main template and further items won't be.
<%ID%> Sitemap node ID
<%ID_entity%> Sitemap node ID_entity
<%ID_parent%> Sitemap node parent ID
<%name%> Sitemap node name
<%name_url%> Sitemap node name in url format
<%path%> Sitemap node path from root
<%level%> Sitemap node level


Item subtree

  • Definition: tree
  • Description: template for item subgroup
  • Variations
    • tree[.levelnumber]
<DEFINITION id="tree">
 <ul>
<#item#>
 </ul>
<#tree#>
</DEFINITION>

Examples and notes

Highlight current node

	<VAR id="ID.current" value="<$main::a210{'ID'}>" />

Highlight top node

	<VAR id="ID.current" value="<$main::a210{'IDs'}[0]>" />

Display tree only 1 level depth from top node

	<VAR id="depth" value="1" />

Display tree from current node

	<VAR id="ID" value="<$main::a210{'ID'}>" />
	<VAR id="depth" value="1" />