Please help me build my sandwich locator maker :)
- I have 3 categories, breads, meats, condiments
- I have a Section called subShops with a matrix field.
- My matrix field is called sandwichBuilder, fields: breads, meats, condiments
- This matrix field is my entry I use for building the sandwiches that the suShops offer.
I want to keep my Categories to make it easy for structure and searching.
How can I build my query so that I can find all entries using a category of bread (over 200 sub categories for bread)? I want the ability to only show those subShops that carry a certain breads based on URL segments (http://example.com/breads/spelt).
Basically, this above url example would list all the subShops that carry spelt bread, so it would display each group including - subShop, bread and typical meats that go best with spelt.
I have tried various ways and many hours trying to figure it out but with unusual results. My code below is my baseline, but need some help from anyone willing to offer examples. This is a pet project and I do plan on sharing the code when complete.
{% set entries = craft.entries.relatedTo(sanwiches).all() %}
{% for entry in entries %}
{{ entry.title }}
{% for row in entry.matrixA %}
{% for option in row.matrixB %}
{{ option }}
{% endfor %}
{% endfor %}
{% endfor %}