Question

I am new to Magnolia and am trying to configure the breadcrumb for a site. I took a look at the documentation, but it is very limited.

<div id="breadcrumb">
     <h5>${i18n['nav.selected']}</h5>
     <ol>
       [#list model.breadcrumb as item]
           [#if item_has_next]
               <li><a href="${item.href}">${item.navigationTitle}</a></li>
           [#else]
               <li><strong>${item.navigationTitle}</strong></li>
           [/#if]
       [/#list]
     </ol> 
</div>

I found the script above which renders the breadcrumb, but struggle with the configuration. Can you give me an example (with picture) if possible?

Thank you very much

Was it helpful?

Solution

I'm not sure you need to configure the breadcrumb for your site.

If you use the STK (Standard Templating Kit) pages templates, like stkArticle, stkSection, etc, then you get the bread crumb trail for free.

What I've done is to extend STK templates then override the areas/main/templateScript value to point at my own freemarker script. The script then looks like this:

    <div id="main" role="main">
        [@cms.area name="breadcrumb" content=content/]
        [@cms.area name="intro" content=content/]
        [@cms.area name="opener"/]
        [@cms.area name="content"/]

        <!-- ADD YOUR SPECIFIC CONTENT HERE -->
    </div>

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top