In my template, I want to:
- Get all the entries in the section 'uploads';
- Get all the assets that are related to one of the upload entries, and have a relation to all the tags I provide.
So, that would be:
{% set company = craft.entries.section('company').id(companyId).first() %}
{% set uploads = craft.entries.section('uploads').relatedTo(company).limit(null) %}
{% set relatedToUploads = ['or'] %}
{% for upload in uploads %}
{% set relatedToUploads = relatedToUploads | merge([upload.id]) %}
{% endfor %}
{% set relatedToTags = ['and'] %}
{% for tag in tags %}
{% set relatedToTags = relatedToTags | merge([tag.id]) %}
{% endfor %}
But, how would I combine those two relatedTo-arrays to one, usable in the ElementCriteriaModel for the assets?