I've got a site with multiple locales and I want to merge together content from across these locales, eg News.
The two sections share the same fields so should theoretically be able to be sorted by a shared criteria.
Looking at the post at How do I sort a collection of entries from multiple sections by date? I can merge these both into a single array but when I try to post the ids
from these into a new query (to sort the results) only one set of results are returned.
Sample code:
{% set ids = craft.entries.section('news' ~ Section).relatedTo(active).ids() %}
{% set mergeIds = craft.entries.section('newsAlumni').status(null).locale('prior_alum').search('shareNewsAlumni:1').localeEnabled(false).ids() %}
{% set ids = ids|merge(mergeIds) %}
{% set news = craft.entries.id(ids).localeEnabled(false).status(null).order(['stickyNews desc','postDate desc']).ids() %}
If I dump the results of ids
I get:
295484 | 3747 | 1787 | 1783 | 1781 | 1778 | 638 | 636 | 640 | 295486
295486 being the entry from mergeIds
being returned.
However, if I dump the results of news
I get:
295484 | 3747 | 1787 | 1783 | 1781 | 1778 | 638 | 636 | 640
Leaving out the result from mergeIds
.
Any thoughts on why the entries from mergeIds
are not being included in the resulting news
object?
Ta
Cole