Breadcrumb example Last updated: 14. Feb 2023

Example on how to show current navigation path for a page.

"#/Nav.hash" example file

#var parts = trim(request.Url, "/").split("/")#
<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
            <a href="/">Home</a>
        </li>

#var curpath = ""#        
#var index = 0#        
#for(var item of parts) {#
    #curpath = curpath + "/" + item#
    #if (index == parts.Length - 1) {#
    	<li class="breadcrumb-item active">#item.replaceAll("-", " ")#</li>
    #} else {#
        <li class="breadcrumb-item">
            <a href="#curpath#">#item.replaceAll("-", " ")#</a>
        </li>
    #}#
    #index++#
#}#
    </ol>
</nav>

Include this breadcrumb in other HASH files with include:

<!--#include file="#/nav.hash"-->