Skip to content

Instantly share code, notes, and snippets.

@ruemic
Last active December 16, 2015 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruemic/5496813 to your computer and use it in GitHub Desktop.
Save ruemic/5496813 to your computer and use it in GitHub Desktop.
The Pop Tags template for rendering our a tour date calendar, which organizes tour dates into years and months with a server side extension.
<!-- Pull in a collection of tour date entries -->
<pop:content from="tour-dates">
<!-- Iterate through a collection of years, each with a 'start' and 'end' attribute -->
<pop:years>
<!-- Render the Year -->
<li>
<pop:start format="yyyy" wrap="h2" class="year"/>
</li>
<!-- Iterate through a collection of months based on the 'start' and 'end' of the Year -->
<pop:months start="<pop:start/>" end="<pop:end/>" break="li">
<div class="month">
<!-- Render the Month -->
<pop:start format="mmmm" wrap="h2" />
<!-- Interate through the collection of tour dates for this Month -->
<pop:entries_for start="<pop:start/>" end="<pop:end/>" wrap="ol">
<!-- Render each tour date and location -->
<li>
<a href="<pop:permalink/>">
<p class="border-bar"><pop:date format="m/dd"/> &mdash; <pop:title/> &mdash; <pop:location wrap="span"/></p>
</a>
</li>
</pop:entries_for>
</div>
</pop:months>
</pop:years>
</pop:content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment