Hot answers tagged

5

nextSiblingOf() and related methods will only work with Structure entries. What you need instead is next() / prev(): https://docs.craftcms.com/api/v3/craft-base-element.html#next (At the time of writing, the 3.x docs seem to be lacking any detail on next/prev methods, but the 2.x docs seem to cover it here: https://craftcms.com/docs/2.x/templating/entrymodel....


3

Some of your steps are unclear, but this should get you started. {% for category in craft.categories.all() %} {{ category.title }} {{ category.url }} {% set entry = craft.entries .relatedTo(category) .orderBy('myField1 ASC') .one() %} {% if entry %} {% set image = entry.myField2.one() %} {% if image %} ...


1

Typically I use an ids() query to do that kind of thing, as it is usually more efficient than a full-blown .all(), like this: {% set allPartnerIds = craft.entries.section('partners').limit(null).ids() %} {% set tiersInUse = craft.categories.group('catPartnerTeirs').relatedTo(allPartnerIds).all() %} If you have already queried for the partner entries ...


Only top voted, non community-wiki answers of a minimum length are eligible