I have a section that needs to display a certain block type (heroVideo) if a lightswitch (displayHeroVideo) within it is active. Otherwise, it should display a different block type (heroImage).
How can I write a conditional to accommodate this?
Here's what I have already which outputs both blocks if the lightswitch is active. How do I apply the conditional earlier?
{# Start hero section #}
{% for entry in entry.heroFeatured.limit(1) %}
{% for block in entry.hero %}
{% if block.type == "heroVideo" and block.displayHeroVideo == "1" %}
<h1>Hero Video Markup</h1>
{% else %}
<h1>Hero Image Markup</h1>
{% endif %}
{% endfor %}
{% endfor %}