1

I have a big scroller in the middle of my front page that shows the latest 3 news entries whose "Front Page Feature" field is set to "Yes". Somewhere else, smaller, I display the next upcoming event whose "Front Page Feature" is set to "Yes". I'd like to combine the 3 newest added news -and- events into that big scroller.

The code to populate the scroller is:

{exp:channel:entries channel="news" search:front_page_feature="Yes" dynamic="no" limit="3" orderby="date" sort="desc"}

I wish I could set channel="news|events", but they use different fieldsets. So I wish I could do channel="news|events" and

search:front_page_feature="Yes" search:events_front_page_feature="Yes"

But "AND" is only allowed with multiple search terms, no OR. I don't know if there will be an easy way to do this.

Any ideas?

  • 3
    Quick question. Why not to use status instead of custom fields? – Robson Sobral Mar 27 '14 at 21:33
  • 1
    If setting a status to define front page items isn't suitable, you might use a category instead. – Nick Benson Mar 27 '14 at 21:49
2

As mentioned in the comments, setting the front page status using a status or category would be a good way to accomplish this.

{exp:channel:entries channel="news|events" status="featured_on_homepage" dynamic="no" limit="3" orderby="date" sort="desc"}

Or...

{exp:channel:entries channel="news|events" category="(id number of category for front page entries could go here)" dynamic="no" limit="3" orderby="date" sort="desc"}

| improve this answer | |
  • Thanks Robson and Nick, I totally forgot about statuses and that fixes it perfectly. – jphansen Mar 28 '14 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.