Is there a way to test if a document is stored only once (first time) or has been stored before and therefor is updated? I want to show an updated-on [*updatedon*] date only if the document has been stored before.
Thanks.
I think, thererfor I am! But what I am, and why...?
I’m not sure but "editedon" can be used for that purpose.
The editedon field is "0" when that document is created but never edited before.
So you can see if the document is updated.
Thanks. I’ll try that.
That didn’t work. As far as I can tell the editedon date is set to the same value as the createddon the first time a document is stored, and not 0.
I think, thererfor I am! But what I am, and why...?
Sorry for bad info.
It seems that creating documents with manager interface and FDM snippet set editedon value ( which is equal to createdon value, I think.)
But only NewsPublisher snippet leave editiedon field blank( "0" ) with document creation.
If that is the case, you could just compare the createdon and editedon fields to see if editedon is greater (which it should be if it’s been modified even if it started as zero), maybe something like this:
<?php
/* compare.snippet
*/
$c_on =$modx->documentObject['createdon'];
$e_on =$modx->documentObject['editedon'];
$output ='';
if( $e_on > $c_on ){
$output .='Whatever should print if editedon is greater than createdon';
}
return $output;
?>

Great. That works. So simple an easy. I really have to get into the MODx api my self.
Thank you both for helping.
I think, thererfor I am! But what I am, and why...?