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.

Get entry titles based on category id

April 12, 2012 6:07pm

Subscribe [2]
  • #1 / Apr 12, 2012 6:07pm

    EpicSoft

    64 posts

    So, I made my nav with categories, so my code looks like this:

    <div class="menu_nav">
            <ul>
              <li><a href="http://{site_link}"><span>Home</span></a></li>
              {exp:channel:categories style="linear"}
              <li><a href="http://{site_link}{category_url_title}"><span>{category_name}</span></a></li>
              {/exp:channel:categories}
            </ul>
          </div>

    Now I want to create a sub menu on another section of the site based on what category that specific page is on. So I used this code:

    <h2 class="star">Sub Menu</h2><div class="clr"></div>
              <ul class="sb_menu">
              {exp:channel:categories style="linear"}
              {exp:channel:entries channel="main" category="{category_id}" orderby="date" sort="asc"}
                <li><a href="http://{site_link}{url_title}">{title}</a></li>
              {/exp:channel:entries}
              {/exp:channel:categories}
              </ul>

    but it doesn’t work does anyone have any other idea on how to approach this?

    Thanks.

  • #2 / Apr 13, 2012 2:19pm

    Shane Eckert

    7174 posts

    Hi EpicSoft,

    I am sorry to hear you are running into this problem.

    I think you might find this Add-On solves your headache. Give this a go and let me know if it works for you.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases