[Evolution 1.0.2, Ditto 2.1]
I’m trying to create a news feed of future events, showing the ones that are closest first.
This is the Ditto call I’m using to show the first event:
[[Ditto? &parents=`11` &orderBy=`event_date ASC` &display=`1` &total=`1` &tpl=`story_summary` &dateSource=`event_date` &noResults=`no_events` &dateFormat=`%d %B %Y` ]]
story_summary looks like this:
<h3 class="date">[+date+]</h3>
<p>[+introtext+]</p>
<p class="continue"><a href="[~[+id+]~]">Read more</a></p>
event_date is a template variable with a user-chosen date for each news item resource. However, the date displayed by [+date+] is 1 January 1970. Ditto, for some reason, can’t be reading this template variable correctly. If I change the dateSource to createdon, then today’s date (on which I created the articles) is shown, so that works fine. Unfortunately I need to show the template variable date because that’s when the event happens.
I don’t think that sorting is working either.
Am I doing something wrong? Is there a different way of calling template variables?