ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

assign class name to nested ul in weblog category?

December 15, 2009 6:25pm

Subscribe [2]
  • #1 / Dec 15, 2009 6:25pm

    K.OS

    4 posts

    hi,

    i have a quick question… i have to change the way categories are listed on my site. At the moment i use

    {exp:weblog:categories weblog="about" style="nested" dynamic="on" class="mainCategoryNav" id="accordion"}
                <a href="http://{path=weblog/index}class=toggler">{category_name}</a>
                {/exp:weblog:categories}

    which generates this html code:

    <ul id="accordion" class="mainCategoryNav">
        <li>
            <a href="http://localhostclass=toggler">About</a>
        </li>
        <li>
            <a href="http://http:/localhostclass=toggler">some element with nested categories</a>
            <ul><!-- class name should be assigned here-->
                <li>
                    <a href="http://localhostclass=toggler">nested category</a>
                </li>
            </ul>
        </li>
    </ul>

    is it somehow possible to assign any class to the second nested element?

    and if this is not possible, is there any workaround to get nested categories using style=“linear” or something?

  • #2 / Dec 15, 2009 6:38pm

    Gareth Davies

    491 posts

    You can’t do it just by using the category tag but can’t you just target nested categories using standard css i.e. something like ul.mainCategoryNav li ul {

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases