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.

ExpressionEngine 1.6.9: displaying a message for no post of a category url

September 19, 2010 7:59am

Subscribe [3]
  • #1 / Sep 19, 2010 7:59am

    art.mania

    12 posts

    hi friends,

    I’m a newbie. I list the blog entries as below. and I need to display a message in case of no blog entry for the active category.

    Appreciate helps! Thanks a lot!

    URL: http://www.example.com/blog/C2/

    CODE Template:

    {exp:structure:paginate parse="inward"}
        {if segment_2 == ""}{exp:weblog:entries weblog="blog" disable="member_data" dynamic="off" limit="4"}{/if}
        {if segment_2 != ""}{exp:weblog:entries weblog="blog" disable="member_data" limit="10"}{/if}
            <div class="blog_post">
  • #2 / Sep 19, 2010 8:00am

    art.mania

    12 posts

  • #3 / Sep 20, 2010 2:22am

    John Henry Donovan

    12339 posts

    art.mania,

    You are using Structure so I am not sure if that has an affect on your no_results tag or not.

    One thing I would not recommend is adding conditionals around your starting weblogs entries tag like that. I would wrap the conditionals around full weblog entries tags

    {if segment_2 == ""}
    {exp:weblog:entries weblog="blog" disable="member_data" dynamic="off" limit="4"}
    {if no_results}
    
    There are no entries available.
    
    {/if}
    
    Content
    
    {/exp:weblog:entries}
    
    {if:else}
    
    {exp:weblog:entries weblog="blog" disable="member_data" limit="10"}
    {if no_results}
    
    There are no entries available.
    
    {/if}
    
    Content
    
    {/exp:weblog:entries}
    {/if}

    Also just a note to use the correct User Guide

  • #4 / Sep 20, 2010 10:10am

    art.mania

    12 posts

    wow it works just great! Thanks for your time. Appreciate!

  • #5 / Sep 20, 2010 10:43am

    Sue Crocker

    26054 posts

    Glad John was able to help. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases