seth_w_jackson
I'm new here

HTML Sitemap

I thought I'd post this function I've worked on to generate an HTML sitemap with all pages within the site structure. Let me know if there's an easier way but this function works great.

<CMS_FUNCTION name="Navigation" resultname="fr_s1">

<CMS_PARAM name="expansionVisibility" value="all"/>

<CMS_PARAM name="siteMap" value="1" />

<CMS_PARAM name="suppressEmptyFolders" value="1" />

<CMS_CDATA_PARAM name="root"><![CDATA[pagefolder:$CMS_VALUE(ss_storeId)$]]></CMS_CDATA_PARAM>

<CMS_ARRAY_PARAM name="pageRefRendering">

<CMS_ARRAY_ELEMENT index="0..10"><![CDATA[

$CMS_SET(set_folderInSitemap, #nav.ref.getParentFolder().getFolderLangSpec(#global.language).getShowInSiteMap())$

$CMS_SET(set_pageInSitemap, #nav.ref.getPageLangSpec(#global.language).getShowInSiteMap())$

$CMS_IF(set_folderInSitemap && set_pageInSitemap)$

$CMS_SET(set_label, #nav.ref.getPageLangSpec(#global.language).getSiteMapLabel())$

<li class="sitemap-section__sublist-li2">

<a href="$CMS_RENDER(template:"page_link", pageref:#nav.ref)$">

$CMS_IF(set_label.isEmpty())$

$CMS_VALUE(#nav.ref.getDisplayName(#global.language))$

$CMS_ELSE$

$CMS_VALUE(set_label)$

$CMS_END_IF$

</a>

</li>

$CMS_END_IF$

]]></CMS_ARRAY_ELEMENT>

</CMS_ARRAY_PARAM>

</CMS_FUNCTION>

0 Kudos
0 Replies