Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
How would I create a menu like this please?

Code: Select all
                <ul>
                    <li><a href="#" class="active">Home</a></li>
                    <li><a href="#">About The DJ</a></li>
                    <li class="child-menu dropdown"><a href="#">Coverage</a>
                       <ul class="dropdown-menu">
                           <li><a href="#">Somerset</a></li>
                            <li><a href="#">Wiltshire</a></li>
                            <li><a href="#">Devon</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Parties</a></li>
                    <li><a href="#">Mood Lighting</a></li>
                    <li><a href="#">Testimonials</a></li>
                    <li><a href="#">Contact</a></li>
                </ul>
Hi Nick,

As we discussed before in your other thread (viewtopic.php?f=2&t=9353&p=20207), you need to use cms:nested_pages tag if you want very fine control over your menu.

I think the following code (adapted straight from the sample given in the docs at http://www.couchcms.com/docs/tags-refer ... pages.html) should create the menu you specified -
Code: Select all
<cms:nested_pages masterpage='your-template-here.php' extended_info='1'>
    <cms:if k_level_start >
        <cms:if k_level='0'>
            <ul>
        <cms:else />
            <ul class="dropdown-menu">
        </cms:if>
    </cms:if>
   
    <cms:if k_element_start >
        <li class="<cms:if k_total_children> child-menu dropdown</cms:if><cms:if k_is_current> active</cms:if>"><a href="<cms:show k_menu_link />"><cms:show k_menu_title /></a>
    </cms:if>

    <cms:if k_element_end ></li></cms:if>
    <cms:if k_level_end ></ul></cms:if>
</cms:nested_pages>

Hope it helps.
2 posts Page 1 of 1
cron