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.

Displaying Child Categories Problem

January 31, 2012 2:05pm

Subscribe [4]
  • #16 / Feb 08, 2012 6:04pm

    Shane Eckert

    7174 posts

    Deep Arora,

    It sounds like you are getting excellent help from Leon.

    Is there anything I can do to help? Please let me know if there is.

    Cheers,

  • #17 / Feb 08, 2012 10:32pm

    Deep Arora

    153 posts

    Hi Deep,

    Bit confused here, did you try the code in the PDF? It was for the 3 categories at the top of the pages. The code you posted is for the left menu?

    Ohh…yeah I tried that code and modified and placed it in for left cats, and it worked perfect 😊

    Ok, lemme try it for top cats as well now.

  • #18 / Feb 08, 2012 10:33pm

    Deep Arora

    153 posts

    Deep Arora,

    It sounds like you are getting excellent help from Leon.

    Is there anything I can do to help? Please let me know if there is.

    Cheers,

    Thanks Shane. Yes Leon is really helpful here. That’s why EE community rocks!!

  • #19 / Feb 08, 2012 11:05pm

    Deep Arora

    153 posts

    Leon - Works perfect 😊

    Top nab is fixed too.

    Now only thing pending is when you open a tutorial, both left and top nav cats lose their references.

    http://www.invanto.com/docs/guide/settings-and-configuration

  • #20 / Feb 09, 2012 2:20pm

    Leon Dijk

    131 posts

    Ok so let’s see how to tackle those. Sorry for the time in between my replies sometimes, I have daytime job so I can only browse the forums as night 😊

    So what code do you have now on the entry page for the top categories menu and what code for the menu on the left?

  • #21 / Feb 10, 2012 2:37am

    Deep Arora

    153 posts

    Sure, here it is:

    For side bar cats:

    {if segment_3_category_parent_id == 0}
     {!-- we are on a root category page --}
     {exp:gwcode_categories cat_url_title="{segment_3}" incl_self="no" style="linear"}
      <li><a href="http://{path=docs/category}/{cat_name}">{cat_name}</a></li>
     {/exp:gwcode_categories}
    {if:else}
     {!-- we are on a child category page --}
     {exp:gwcode_categories cat_id="{segment_3_category_parent_id}" incl_self="no" style="linear"}
      <li>
     <a href="http://{path=docs/category}/{cat_name}" class="active">{cat_name}</a>
      </li>
     {/exp:gwcode_categories}
    {/if}
    </ul>

    For top cats:

    {exp:channel:categories channel="docs" parent_only="yes"}
      <a href="http://{path=docs}" class="active">{category_name}</a>
     {/exp:channel:categories}
  • #22 / Feb 10, 2012 2:25pm

    Leon Dijk

    131 posts

    Ok, so for the top menu on the entry pages, you could do something like this? (with PHP enabled on output)
    Make sure you change the parameters in the exp:channel:entries tag below.

    {exp:channel:entries channel="test" entry_id="1" dynamic="off" limit="1"}
     {!-- store main category for this entry in a php variable to be used for later--}
     {categories limit="1"}<?php $entry_main_category = "{category_id}"; ?>{/categories}
    
     {!-- show top menu --}
     {exp:channel:categories channel="test" parent_only="yes"}
      <a href="#" class="active">{category_name}</a>
     {/exp:channel:categories}
     
     {!-- show entry information such as title --}
     {title}
    {/exp:channel:entries}
  • #23 / Feb 13, 2012 11:25am

    Shane Eckert

    7174 posts

    Hello Deep Arora,

    Checking in to see where you are in the process?

    Would you mind pasting in your code so far? Would love to review it and make suggestions.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases