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 conditional problem

November 12, 2009 12:53pm

Subscribe [2]
  • #1 / Nov 12, 2009 12:53pm

    taktak

    24 posts

    Hiya,
    Doing some conditionals with a no_results to determine wether or not a 404 appears, it works fine in some occasions, but in others…

    site.com/asdf/ triggers the no_results, which is cool!
    site.com/page_exists/asdf/ does not trigger the no_results, as it falls back to page_exists.

    Is there a way around this problem?

    Here’s my code:

    {exp:weblog:entries weblog="general-page" limit="1" require_entry="yes"}
                    {if no_results}
                    404 logic
                    {/if}
    
                    ....
    
    {/exp:weblog:entries}
  • #2 / Nov 12, 2009 3:38pm

    Ingmar

    29245 posts

    Please take a look at strict URLs. In your case, you’ll probably want to use require_entry=“yes” as well.

  • #3 / Nov 13, 2009 6:13am

    taktak

    24 posts

    Thanks Ingmar, that helped resolve my issue!

  • #4 / Nov 13, 2009 6:33am

    Ingmar

    29245 posts

    Very glad to hear that 😊 Please don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases