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.

IF entry from first Category, display it, ELSE display from other Category

October 27, 2007 9:14pm

Subscribe [1]
  • #1 / Oct 27, 2007 9:14pm

    doclalor

    1 posts

    Hello, folks. I want to display ONE weblog entry in a block. I want to give priority to one Category from which it should be drawn; but if there is not an entry available there, I want to display an entry from another Category. What I am trying does not work, because I guess I cannot use EE tags within {if no_results}.

    It’s this:

    {exp:weblog:entries weblog="alerts" category="35" orderby="date" limit="1" require_entry="yes" dynamic="off”}
    <div>{title} - {teaser}</div>
    {if no_results}
      {exp:weblog:entries weblog="alerts" category="23" orderby="date" limit="1" require_entry="yes" dynamic="off”}
    <div>{title} - {teaser}</div>
      if no_results}
        <div><p style="padding: 12px;">There are currently no entries.</div>
      {/if}
    {/if}
    {/exp:weblog:entries}

    So what should I do?!

    Thanks in advance.

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

ExpressionEngine News!

#eecms, #events, #releases