There is a publishMonth
(multiselect) and publishYear
(radio buttons) field in each article. They do not correspond to an actual date. Each article is is associated with one year, or one or more months. I'd like my editor to be able to change two global variables. currentMonth
(radio button), and currentYear
(radio button) to change all the articles display on the webpage at once at any time she pleases. Some articles may be associated with one or more months. Articles do not get changed over at the same date and time each month, which is why it's not associated with a real month or year. The code below returns nothing.
The idea is to make it as easy as possible for my editor to "flick the switch" to the next month.
{% set dogs = craft.entries.section('news').order('articleOrder desc').limit(5) %}
{% for entry in dogs %}
{% if entry.publishYear in currentEdition.currentYear %}
<a href="{{ entry.url }}"><h2>{{ entry.title }}</h2></a>
{% for image in entry.images.limit(1) %}
<img src="{{ image.getUrl('frontPageThumbnail') }}" class="main-image">
{% endfor %}
<p>{{ entry.body|striptags|slice(0,300) }}... <a href="{{ entry.URL }}" class="readmore">Read more</a></p>
<p>{{ entry.publishYear }}</p>
<ul>
{% for option in entry.publishMonth %}
<li>{{ option }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}