$sitemap
is a variable that contains the entire structure of the site. It basically is a tree with the home page as its root node, and propogating down to its children and its children's children. To better understand the concept of the sitemap, the best example is to view this site's sitemap.see also {foreach}, {if}{else}{/if}, {include}.
Sample Usage:
(e.g. sitemap.tpl)
{include file="show.children.tpl" children=$sitemap}
(e.g. show.subchildren.tpl)
{if $children}
{assign var="nav_children" value=$children}
{/if}
{if count($nav_children) > 0 }
<ul>
{foreach item="$nav_child" from=$nav_children}
<li>
<a href={$nav_child.link}index.php> {$nav_child.title}</a>
{if count ($nav_child.children) > 0 }
{include file="subchildren.tpl" children={$nav_child.children}}
{/if}
</li>
{/foreach}
</ul>
{/if}
HTML Source Output
<ul>Note: Some of the source output has been condensed for the sake of clarity in this html document.
<li><a href="../News/">News</a></li>
<li><a href="../GettingStarted/">Getting Started</a>
<ul>
<li><a href="../GettingStarted/Web.Designer/">Web Designer</a>
<ul>
<li><a href="../GettingStarted/Web.Designer/Entries/">Entries</a></li>
.
.
.
</ul>
</ul>
...
<li><a href="../Sitemap/">Sitemap</a></li>
</ul>