Last active
July 8, 2016 10:48
-
-
Save niallthompson/af1dd27d5db1ba23cf74 to your computer and use it in GitHub Desktop.
Craft Calendars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Upcoming {{ "Events"|t }}</h1> | |
{% set upcomingparams = { | |
calendar: 'projectEvents', | |
dateRangeStart: 'today', | |
dateRangeEnd: 'next year' | |
} %} | |
{% for e in craft.calendars.eventData(upcomingparams).events %} | |
<article class=""> | |
<hr class="rule rule--dashed"> | |
<h2>{{ e.element.title }}</h2> | |
<h5 class="subtitle">{{ e.startDate | date("d M Y") }}</h5> | |
<h5 class="subtitle">{{ e.element.subtitle }}</h5> | |
<div class="google-maps-strip"> | |
{% for marker in e.element.eventMap.getMarkers() %} | |
{% set options = { | |
id: 'map', | |
width: '100%', | |
height: '100px', | |
options: { | |
maxZoom: 15, | |
minZoom: 5 | |
} | |
} %} | |
{{ craft.googleMaps.map(options) }} | |
{{ craft.googleMaps.data('map', e.element.eventMap) }} | |
{% endfor %} | |
</div> | |
<a href="{{ e.element.url }}" class="margin-top button button--ujarak button--border-thin button--text-thick">{{ "More" | translate }}</a><br> | |
</article> | |
{% endfor %} | |
<hr class="rule rule--thin margin-top"> | |
<h1>Past {{ "Events"|t }}</h1> | |
{% set pastparams = { | |
calendar: 'projectEvents', | |
dateRangeStart: '2013', | |
dateRangeEnd: 'yesterday' | |
} %} | |
{% for p in craft.calendars.eventData(pastparams).events %} | |
<article class=""> | |
<hr class="rule rule--dashed"> | |
<h2>{{ p.element.title }}</h2> | |
<h5 class="subtitle">{{ p.startDate | date("d M Y") }}</h5> | |
<h5 class="subtitle">{{ p.element.subtitle }}</h5> | |
<div class="google-maps-strip"> | |
{% for marker in p.element.eventMap.getMarkers() %} | |
{% set options = { | |
id: 'map', | |
width: '100%', | |
height: '100px', | |
options: { | |
maxZoom: 15, | |
minZoom: 5 | |
} | |
} %} | |
{{ craft.googleMaps.map(options) }} | |
{{ craft.googleMaps.data('map', p.element.eventMap) }} | |
{% endfor %} | |
</div> | |
<a href="{{ p.element.url }}">{{ "More" | translate }}</a><br> | |
</article> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment