Event Countdown mit getResources (Dokumente mit TV 'eventDate')
benötigt:
- jQuery und das Plugin von Keith Wood (http://keith-wood.name/countdown.html)
- Snippet 'today_year', 'getStrftime' und 'limitWholeWords'
countdown<script type="text/javascript">
/* <![CDATA[ */
$(function () {
var myDay = new Date();
myDay = new Date(
[[!getResources:default=`[[!today_year]], 12-1, 31`? &parents=`42` &tpl=`tplCountdownDate` &limit=`1` &sortbyTV=`eventDate` &sortdirTV=`asc` &sortby=`` &includeTVs=`1` &includeContent=`0` &tvFilters=`eventDate>=[[!getStrftime? &format=`%Y-%m-%d`]]`]]
);
$('#defaultCountdown').countdown({until:myDay,format:'DHMS',compact:false,description:'',
layout:'<div class="countdown_text">Noch</div><div class="countdown_days">{dn}</div> <div class="countdown_text">{dl}</div> <b>{hn}</b> {hl} <br /> <b>{mn}</b> {ml} <br /> <b>{sn}</b> {sl}'});
});
/* ]]> */
</script>
<h4>[[$countdownText]]</h4></div>
<div id="defaultCountdown"></div>
Chunk countdownText[[!getResources:default=`Silvester Countdown`?
&parents=`42`
&tpl=`tplEventCountdownText`
&limit=`1`
&sortbyTV=`eventDate`
&sortdirTV=`asc`
&sortby=``
&includeContent=`0`
&tvFilters=`eventDate>=[[!getStrftime? &format=`%Y-%m-%d`]]`]]
Chunk tplEventCountdownText[[+pagetitle:limitWholeWords=`100`]]
Chunk tplEventCountdownDate[[+tv.eventDate:strtotime:date=`%Y`]], [[+tv.eventDate:strtotime:date=`%m`]]-1, [[+tv.eventDate:strtotime:date=`%d`]]