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.

Category List Challege

January 24, 2012 9:16pm

Subscribe [2]
  • #1 / Jan 24, 2012 9:16pm

    Cartegraph

    83 posts

    I have a challenge for anybody willing to participate. I have to have a list of categories be displayed as the following html.

    <ul>
       <li>Documents</li>
        <ul>
         <li>Why Cartegraph</li>
         <li>Solutions Materials</li>
         <li>Services Materials</li>
         <li>Success Stories</li>
         <li>Partner Materials</li>
         <li>Technical Specifications</li>
         <li>Presentation Library</li>
        </ul>
       <li>Other Resources</li>
       <li>Sales Teams</li>
       <li>Sales Tools</li>
        <ul>
         <li>Why Cartegraph</li>
         <li>Solutions Materials</li>
         <li>Services Materials</li>
         <li>Success Stories</li>
         <li>Partner Materials</li>
         <li>Technical Specifications</li>
         <li>Presentation Library</li>
        </ul>

    The problem is when EE outputs categories to lists, it nests the <ul> in a <li> I need the <ul> to be a sibling of the <li>. Has anyone run across an need for this? Basically I need the nested categories to be grouped. That could be in a <div>, a <ul> or any other element for that matter. It doesn’t really matter to me I just need it in it’s own group.

    Here is my page http://www.cartegraph.com/intranet/
    The code behind this page represents how it should work. I appreciate any help!

    Lucas JD

  • #2 / Jan 24, 2012 11:57pm

    Enviromed

    375 posts

    Nice color pallette Good luck with your project

    http://devot-ee.com/add-ons/gwcode-catmenu

  • #3 / Jan 25, 2012 10:27am

    Cartegraph

    83 posts

    Thanks for the comment!

    For some reason i am not able to get this plugin to do what I need. Have you used it before? I am sure I am just using it incorrectly. What parameters would I use to get the plugin to give me my desired html back?

    K got it to kind of work but it is still nesting the <ul> as a child of the <li> I need them to be siblings. Any ideas?

  • #4 / Jan 25, 2012 10:35am

    Enviromed

    375 posts

    Best to work directly with the developer on your site specific issues.  http://devot-ee.com/developers/leon-dijk

  • #5 / Jan 25, 2012 12:30pm

    Cartegraph

    83 posts

    Thought I’d post my solution for anybody interested.

    here is my html.

    <ul>
      {exp:channel:categories channel="sales" style="linear"}
       
       <li {if parent_id != 0}class="sub"{/if}><div class="filter-checkbox"></div>{category_name}</li>
       
      {/exp:channel:categories}
      </ul>

    I am also running a jQuery method that looks for a grouping of class=“sub” elements and wraps them in a <ul></ul>

    $('.sub').wrapAll('<ul></ul>');

     

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

ExpressionEngine News!

#eecms, #events, #releases