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.

Using channel:entries search parameter with multiple channels

June 15, 2012 3:28pm

Subscribe [1]
  • #1 / Jun 15, 2012 3:28pm

    John-Gordon

    76 posts

    This question may be related to a resolved thread.

    EE 2.5.2

    Hey guys,

    I have one channel:entries tag on the homepage and it’s pulling from multiple channels. I have a custom field in each one that selects whether the content should be a feature on the homepage or not.  Here is the code:

    {exp:channel:entries channel="interview|story" limit="2" search:story-is-home-feature="=y" search:interview-is-home-feature="=y" disable="categories|member_data|pagination" dynamic="no"}

    Using this code renders nothing as it’s looking for the entry to contain both custom fields, which they are don’t, so it is not finding any entries.

    Is there another way of doing this that I’m missing? Would be a huge timesaver if I can get this to work.

    Thanks

  • #2 / Jun 18, 2012 10:56am

    Dan Decker

    7338 posts

    Hi John-Gordon,

    I would suggest doing a conditional in the channel entries tag pair. Kinda like this:

    {exp:channel:entries channel="interview|story" limit="2" disable="categories|member_data|pagination" dynamic="no"}
    {if story-is-home-feature == "y"}
      {title}
      {body}
    {/if}
    {if interview-is-home-feature == "y"}
      {title}
      {body}
    {/if}
    {/exp:channel:entries}

    That should be close to what you are after.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases