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 tag does not work when using conditionals in MSM sites

February 27, 2014 9:12pm

Subscribe [2]
  • #1 / Feb 27, 2014 9:12pm

    gbederson

    92 posts

    Is there a way to get the no_results tag to work when using conditionals and msm? The problem is that I cannot use the search: parameter to limit the results, because it seems the Multiple Site Manager does not recognize “search:”. MSM does work with conditionals, though, so I am forced to use them. But no_results does not recognize conditionals.

    The following code does not work, because search is not functional with the “site=” tag.
    <pre><code>{exp:channel:entries site="implications" channel="place" search:url_title="{embed:place}”}
    {if url_title == "{embed:place}”}
    {title}
    {if no_results}No successes yet.{/if}
    {/if}
    {/exp:channel:entries}</code></pre>

    The following code returns the correct results for “{title}”, but no_results is incorrect because it is not limited by the conditional.

    {exp:channel:entries site="implications" channel="place"}
    {if url_title == "{embed:place}"}
    {title}
    {if no_results}No successes yet.{/if}
    {/if}
    {/exp:channel:entries}

    How can I show no_results when using MSM and limiting the results with search: or conditional?
    Any help would be appreciated!

    Geoff

     

     

  • #2 / Mar 07, 2014 7:06am

    ahmad saad

    364 posts

    Hi,

    as I think there is no problem with MSM , the problem is in your code itself:

    first: url_title not work with search: u must use url_title param http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html#url-title

    second: when u need to use no_results condition , there is no need to put it in any tag, just put it in the first line after {channel:entries} loop and it will do the trick.

    so your code will be:

    {exp:channel:entries site="implications" channel="place" url_title="{embed:place}"}
    {if no_results}No successes yet.{/if}
    {title}
    {/exp:channel:entries}

     

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

ExpressionEngine News!

#eecms, #events, #releases