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 no_results} weblog nesting

October 31, 2008 4:57pm

Subscribe [2]
  • #1 / Oct 31, 2008 4:57pm

    David Boyer

    12 posts

    From what I understand nesting weblogs is no-no however if this true how do I go about setting a conditional so that when there are no results from one weblog I can display an entry from another?

    I though something like this but the not without nesting weblogs:

    {exp:weblog:entries weblog="ABC" limit="1" show_future_entries="yes" show_expired="no" dynamic="off" sort="asc"}
    
      Content if not expired
    
       {if no_results}
         {exp:weblog:entries weblog="XYZ" limit="1" dynamic="off" sort="asc"}
           Content from XYZ weblog if ABC weblog is expired
         {/exp:weblog:entries}
        {/if}
    
    {/exp:weblog:entries}

    Thoughts, tips, tricks?

    Thanks!

  • #2 / Dec 12, 2008 3:13am

    MotoNomad

    32 posts

    Maybe setting a “Dynamically Assigned Variable”?  (its really a statically assigned if I remember correctly )

    {assign_variable:uh_oh='yes'}

    Then testing for it outside the weblog tag

    {if uh_oh=='yes'} ..... {/if}
  • #3 / Dec 12, 2008 12:13pm

    PhireGuys

    525 posts

    Use EMBED.  You can embed within the no_results check and it will pull everything you need.

    Works for me.

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

ExpressionEngine News!

#eecms, #events, #releases