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.

{no_results} not working on exp:channel_entries nested inside {exp:channel_catgegory_archive}

February 26, 2011 6:52pm

Subscribe [1]
  • #1 / Feb 26, 2011 6:52pm

    OutofControl

    164 posts

    Here is the code:

    <div class="accordian">
    
    {exp:channel:category_archive channel="Tutorials" show="60|65|131|29|122|30" style="linear"}
    {categories}
    <h2 id="{category_url_title}" class="mtl">{category_name}</h2>
    
    <div class="column_2">
    <dl>
    
    {exp:channel:entries category="{category_id}&136;" dynamic="no" require_entry="yes" disable="categories|member_data|pagination"}
    
    {if no_results}<dt><a href="#">There are no {cat_name} submitted yet.</a></dt>{/if}
    
    <dt><a href="#">{title}</a></dt>
    <dd>
    {body}
    <a href="http://{link_url}" rel="external" title="{title}">Visit homepage</a>
    </dd>
    
    {/exp:channel:entries}
    
    </dl>
    </div>
    {/categories}
    {/exp:channel:category_archive}
    </div>

    Can anyone see why the no_results doesn’t work? If it is not possible to have no_results work inside the category_archive tag, is there another way around this?

  • #2 / Feb 27, 2011 2:02pm

    John Fuller

    779 posts

    Not sure offhand as I try to avoid this sort of situation due to possible conflicts.  What I generally do instead is to do an embed.  So, put the channel entries tag in a different template and call that template as an embed.  Send the category_id as a embed variable.

  • #3 / Feb 27, 2011 2:53pm

    OutofControl

    164 posts

    Right! That did the trick and in the end helped me simplify the layout on that entire section.

    Thank you very much John

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

ExpressionEngine News!

#eecms, #events, #releases