What did you name your chunk?
[[ditto? &tpl=`my_news` &parents=`25`]]
This is definitely a Ditto problem, related to the fact that MODx no longer returns these fields in UNIX timestamp format; these are returned in the standard MySQL datetime format and can be easily formatted with the strtotime and date output filters, i.e.
[[+publishedon:strtotime:&display=`20` &total=`20`date=`%b %e, %Y`]]
[[Ditto? &parents=`40` &tpl=`event_blog` &orderBy=`[[unixtime? &timeStr=`eventDate`]] ASC` &dateSource=`eventDate:strtotime`]]
<h3>[[+title]] - [[+date]]</h3> <p>[[+introtext]] <a href="[[~[[+id]]]]">More >></a></p>
Is there a reason getResources will not work for your needs here? TBH, Ditto needs a lot of work for Revolution and no one has yet stepped up to volunteer to maintain it.
I am getting Dec 69 as my date, can any suggest a way I might get this to work?
Is there a reason getResources will not work for your needs here?
$resource[$dateSource] = $dateValue + $modx->config["server_offset_time"];
$resource[$dateSource] = date("Y-m-d H:i:s",strtotime(date("Y-m-d H:i:s", strtotime($dateValue)) . " +".$modx->config["server_offset_time"]." hours"));
$placeholders['date'] = strftime($dateFormat,$timestamp);
$placeholders['date'] = strftime($dateFormat,strtotime($timestamp));
I use Ditto to generate google sitemap xml. I am not sure if its possible to do with getResources.
I am running:I made a fix, Just open Ditto snippet in manager, and find line:
MODx Revolution 2.0.0-rc-1 rev6614
Ditto 3.0 Alpha 3
The formatting is coming out "By Default Admin User on December 31, 1969 18:33." The publishedon date is not December 31, 1969, it is April 09, 2010
[[Ditto? &parents=`11` &display=`2` &tpl=`ditto_news` &dateSource=`publishedon` &dateFormat=`%B %d, %Y %H:%M` &paginate=`1` &extenders=`summary` &paginateAlwaysShowLinks=`1`]]
<div class="ditto_summaryPost"> <h3><a href="[[ ~[[+id]] ]]" title="[[+title]]">[[+title]]</a></h3> <div class="ditto_info" >By <strong>[[+author]]</strong> on [[+date]]. </div> [[+summary]] <p class="ditto_link">[[+link]]</p> </div>
Any thoughts?
for ($x=$start;$x<$stop;$x++) { $template=$ditto->template->determine($templates,$x,0,$stop,$resource[$x]["id"]);
$renderedOutput=....
$resource[$x]['publishedon']=strtotime($resource[$x]['publishedon']);