Craft gives you a lot of options here. I think you're close. The way I'd set it up:
- Boats (section)
- Suppliers (section)
- Boat Type (category)
Then in your boats section, set up a Supplier
relational field, and have it relate back to your suppliers
section and also a Boat Type
relational field, which relates back to that category group.
In this way, on the front end, you can easily filter by boat type or supplier.
Example: on your supplier pages, you can easily get a list of all the boats made by that supplier, just by querying that section like:
{# assume we're on a supplier page #}
{% set boatsBySupplier = craft.entries.section('boats').relatedTo(entry) %}
{% for theBoat in boatsBySupplier %}
<h2>{{theBoat}}</h2>
<p>Model: {{theBoat.modelNumber}}</p>
...
{% endfor %}
In terms of templating, there won't be a huge difference if you choose a category over an entry, for example, for your suppliers.
I tend to think of brands (suppliers) as content, thus content belongs in an Entry, not in a taxonomy (category). (Down the road you might want to have more than one supplier type, for example.)
But if your data on suppliers is relatively thin, a category would work just as well. Even then, unlike other CMS, Craft allows you to use custom fields on Categories to add more data. So there's no wrong answer there. In that case, Craft will populate the category
variable (and not entry
) so just change that and you should be all good.
Not sure what you mean here:
But does it make more sense to use suppliers as entries [fields] and relate them to products as 'parents'?
If you're asking about setting up a structure, and having the top level parent be the supplier and the boat model be a child, I'd steer clear of that. A lot of things can go wrong with that model.
In general, I like to keep data structures as "flat" as possible and create depth with Craft's relationships. But if you're asking about using entries fields to relate your suppliers back to your boats, that's exactly what my example above does.