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.

I can't read the category in the URL in {exp:channel:categories}

August 16, 2010 12:48pm

Subscribe [2]
  • #1 / Aug 16, 2010 12:48pm

    dzr_rtw

    86 posts

    i have URL site/faqs = it shows all FAQs grouped by category

    CATEGORY NAME
    faq here & answer
    and another faq & answer
    another faq & answer

    NEXT CATEGORY
    a new faq & answer
    another faq & answer

    I need to also be able to go to URL site/faqs/category/next_category and have it show only the “next category”  *but that still shows all the entries.

    NEXT CATEGORY 
    a new faq
    another faq



    this is what i have:

    {exp:channel:categories channel="faqs" style="linear" show_empty="no"}
       <h3>{category_name}</h3>
    <p>   {exp:channel:entries channel="faqs"  category="{category_id}"}<br />
          </p><h4>{title}</h4>
    <p>      <br />
    {faq_body} </p>
    
    <p>   {/exp:channel:entries}<br />
    {/exp:channel:categories}

    If I get rid of the exp:channel:categories it works but then it’s not grouped by category.


    Any insight on the best way to accomplish what I need?

  • #2 / Aug 16, 2010 12:56pm

    dzr_rtw

    86 posts

    I can also get the same result with exp:channel:category_archive but still I can’t show just one category.

  • #3 / Aug 16, 2010 5:20pm

    martaspendowska

    41 posts

    I am not sure if this is what you are looking for…
    I display my categories like so :

    <ul class="categories">
            {exp:channel:categories channel="{embed:channel_name}" style="nested"}
                <li><a href="http://{path=">{category_name}</a></li>
            {/exp:channel:categories}
    </ul>

    That’s my embed for categories, where /index/view is where I want them to show up ( each channel has VIEW template listing all posts from the category).

    Then I make another embed : global_embeds/sidebar where I can place my category embed :

    <h2>Design</h2>
    <p>    {embed="global_embeds/acategories" channel_name="design" template_group_name="design" status="Featured|Open"}  <br />
        </p><h2>Health</h2>
    <p>    {embed="global_embeds/acategories" channel_name="health" template_group_name="health" status="Featured|Open"}


    I hope it helps…

    Marta

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

ExpressionEngine News!

#eecms, #events, #releases