Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% set monthIds = craft.categories.group('months').ids() %}
- {% for monthId in monthIds %}
- <div>
- {# group each months entries #}
- {% for item in craft.entries.section('sectionName').relatedTo({targetElement:monthId}) %}
- {# content for each entry. #}
- {% endfor %}
- </div>
- {% endfor %}
- {# 1 == January #}
- {% for month in 1..12 %}
- <div>
- <h2>MONTH {{ month }}</h2>
- {# group each months entries #}
- {% for item in craft.entries.section('blog') if item.postDate|date("n") == month %}
- {# content for each entry. #}
- <h3>{{item.title}}</h3>
- {% endfor %}
- </div>
- {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement