I have a page that lists a bunch of project data if it is present.
At the moment the twig structure is doing something like:
{% if entry.partners|length %}
{% for data in entry.partners.all() %}
{{ data.title }}
{% endfor %}
{% endif %}
{% if entry.awards|length %}
{% for data in entry.awards.all() %}
{{ data.title }}
{% endfor %}
{% endif %}
etc... theres 6 or seven of these possible entry types Im looking at.
I am wondering if I can use a 'switch' setup like this:
{% switch entry.type %}
{% case "typeA" %}
{% case "typeB" %}
{% endswitch %}
Following the @james-smith suggestion, I tried this to see if I could winkle out an associated 'client' — which definitely exists — unfortunately this code below does not work either...
{% switch entry.type.handle %}
{% case 'clients' %}
{% for data in entry.clients.all() %}
{{ data.title }}
{% endfor %}
{% endswitch %}
thanks for looking!