Hi,
I have a very simple question, but a search has not helped solve it.
Basically I want to know how I can call the published date of a document. I have tries [+date+] but that calls the actual date.
The reason I am asking is that I have a back dated blog entry 5/6/09 that I now want to make live, but I want the date to show it as being published to the user on 5/6/09
-
☆ A M B ☆
- 24,524 Posts
Then you don’t want the pub_date, which will be the date you actually publish the document. You want the create_date.
You could just create a date template variable and show that. You could put whatever you want in it. I think you could set the default value to the published or created date but I’ve never tried it.
To change the source for the [+date+] placeholder you need to use the &dateSource parameter in the call. To use pub_date set it like &dateSource=`pub_date`.
Note that Ditto will use another date source if there is no pub_date for the document (not sure the hierarchy, but I think it goes to publishedon). If you want to limit it to only using pub_date, then use the [+pub_date+] placeholder and format it either with PHx [+pub_date:date=`%d.%m.%Y`+] or using the dateTime (or other) snippet.
PHx is available to use within Ditto TPLs natively, no need to install PHx to use it in Ditto.