I am looking to do the following.

I'd like to display a list of entries from two sections. That much is straightforward; however the kicker is that I only want entries related to a specific category of one of the sections.


  • Everything from SectionA
  • Only CategoryC from SectionB



You would do such things by first getting the entries IDs and then do a query to get all entries with these IDs:

{% set entryIdsA = craft.entries.section('SectionA').ids() %}
{% set entryIdsB = craft.entries.section('SectionB').relatedTo('CategoryC').ids() %}

{% set allEntryIds = entryIdsA|merge(entryIdsB) %}

{% set allEntries = craft.entries.id(allEntryIds).order('mySortByField desc') %}
  • Thank you @carlcs, the merge filter is all sort of awesome. – SethG Dec 5 '14 at 2:59

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.