I'm pretty new to Twig and I know the level here is far above my question, but thank you in advance...
I'm designing a site with sponsor logos on the homepage, each sponsor is an entry in a channel of sponsors. I have a lightswitch field on the entry page called 'showOnHome'. I've tried "if" statements and conditionals in the loop, but have only got to where it shows the first entry and breaks the loop.
The following works to get all of the entries,
<ul>
{% for entry in craft.entries.section('sponsors') %}
{% for image in entry.sponsorlogo %}
<li><a href="{{ entry.getUrl }}"><img src="{{ image.getUrl() }}" alt="{{ image.title }}"</a></li>
{% endfor %}
{% endfor %}
</ul>
How do I only get entries where showOnHome == '1'?
Thank you in advance for helping the rookie.