There are a number of ways to organize this using any combination of channels, structures, or categories — it's hard to give a recommendation on which way is better without knowing a little more about your site requirements.
Much will depend on things like:
- Will there be pages for both 'focus-areas' and 'initiatives' (or is one just used for organization)?
- How the uri's should look? (i.e. 'focus-area/initiative/' or '/focus-areas/focus-area/' & '/initiatives/initiative')
- Are the relationships 'one-to-one' or 'many-to-one'?
- Are the pages hierarchical and/or need a specific order defined?
- Do the pages need entryTypes (because the layout and/or field requirements are unique for different pages)?
- Do you need to generate site-navigation dynamically?
Answering these questions will generally narrow down the options.
On each Focus Area page, I would like to show all Initiatives associated. Currently, for each Initiative, I have a Radio Button for each Focus Area it fits under.
Typically, instead of a radioButton, you would create a relationship between any two channels/structures/categories using the EntriesFieldType
. Once you have added the field to your focus-areas field layout, and added some related initiative entries, you can access the related initiatives using:
{% for initiative in entry.initiatives %}
<li>{{ initiative.title }}</li>
{% endfor %}
or
{% set initiatives = craft.entries.section('initiatives').relatedTo(entry) %}
{% for initiative in initiatives %}
<li>{{ initiative.title }}</li>
{% endfor %}
Would this be an appropriate use case for Categories?
Maybe. If you want to conceptually consider them as categories (and categories fit all your other needs) then go for it. Otherwise the difference between categories and structures/channels is pretty minor (with the exception that categories do not support entryTypes
).
Should I instead be using Entry Types for each Focus area?
Maybe. EntryTypes
are generally used when the field and/or layout requirements are unique in some way for the various entries. If the relationship between 'focus-areas' and 'initiatives' is one-to-one, and if you want the uri's to be 'focus-area/initiative' then a good option might be to combine the two structures together hierarchically and use EntryTypes
to define the unique layout and fields requirements for each. In your template you would then check the entry's type and change the layout or include a sub-template.
{% if entry.type = "initiative" %}
{% include '_initiative.html' %}
{% endif %}
You can also use this approach site-wide to generate more dynamic site navigation, using craft's nav
tag.