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_result not working

June 22, 2011 3:01am

Subscribe [2]
  • #1 / Jun 22, 2011 3:01am

    BrianPx

    14 posts

    Hello,

    I’m trying to display “There are no currently no related articles.” when exp:channel:entries returns no results.  I can’t get this line to run though when there are no results.  Any ideas?  I am running the latest version of ee.


    HTML:

    <h3>Related Entries</h3>
    <p>                <ul><br />
                    {exp:channel:entries channel="news" status="Homepage Featured|Homepage Secondary|open" limit="3" related_categories_mode="yes" custom_fields="yes"}<br />
                    <br />
                    <br />
                    {if no_result}        <br />
                    There are currently no related articles.<br />
                    {/if}        <br />
                        <li class="{switch='first|second|last'}"><br />
                            <em>{entry_date format="%F %d, %Y"}</em><br />
                            </p><h4><a href="http://{title_permalink=news/view}">{title}</a></h4>
    <p>                        {news-excerpt}<br />
                        </li>                <br />
                    {/exp:channel:entries}<br />
                    </ul>

  • #2 / Jun 22, 2011 3:35am

    BrianPx

    14 posts

    Duh,

    should have been {if no_results}  NOT {if no_result}  (I left the “s” off)

    why is code unforgiving?  :(

  • #3 / Jun 22, 2011 12:23pm

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases