hello, I’m trying to change Ditto snippet and to show article "published on" date and not "created on" date.
I changed the code in Ditto snippet:
*/
$dateSource = isset($dateSource) ? $dateSource : "pub_date";
/*
But in my webpage it is still displaying the "created on" date. The date is called out with the chunk:
<div class="ditto_summaryPost">
<h2>[+title+]</h2>
<div class="ditto_info" >[+date+] </div>
[+summary+]
<p class="ditto_link">
<a href="[+url+]">daugiau...</a>
Can someone help me with this one? Is their any other place where I have to change "createdon" with the "pub_date"?
Thanks in advance.
-
☆ A M B ☆
- 24,524 Posts
Using the &dateSource parameter doesn’t work? You shouldn’t need to modify the Ditto code itself.
I changed the code in Ditto snippet:
It was:
*/
$dateSource = isset($dateSource) ? $dateSource : "createdon";
/*
And now it is:
*/
$dateSource = isset($dateSource) ? $dateSource : "pub_date";
/*
But the result in my web page is the same - it is showing the creation date...
Modxcms is really tricky for me, don’t know what else to do : (
-
☆ A M B ☆
- 24,524 Posts
You should be able to leave the Ditto code alone, and in your Ditto snippet call put:
[[Ditto? ... &dateSource=`pub_date` ... ]]
http://ditto.modxcms.com/files/snippet-ditto-php.html#dateSource
Ok, understood (at last) : )
now it works, thank you.