-
☆ A M B ☆
- 1,231 Posts
Hey folks,
I’m wishing to show when a document was last edited on and I’ve searched the forums and tried to make sense of all the ideas.
Basically if I use ditto and put the placeholder in my Tpl [+editedon+] it’s showing the Unixtime 1214602234. I’ve tried understanding PHx and when I used the placeholder it had in the wiki, the time format was right but the date was set to 1970.
If I use [+date+] the date is correct but I want to use editedon so the user knows when the document was last edited (of course lol).
Could someone be so kind to help me?
Ross
EDIT: I finally got it working using [+editedon:date=`%a %B %d, %Y at %H:%M`+]
-
☆ A M B ☆
- 1,231 Posts
On a related note... I have a parent folder and 3 child docs within this parent. I would like the parent to reflect that the child docs have been updated. How can I make ditto tell the parent that it one of it’s child docs have been updated and have it show in the parent link that it was updated on date xxx.
Thanks.
-
☆ A M B ☆
- 1,231 Posts
I’m using Ditto...
My tpl is
<div class="ditto_item" id="ditto_item_[+id+]">
<h4 style="padding:10px" class="ditto_pageTitle"><a href="[~[+id+]~]">[+author+]’s [+pagetitle+]</a>
Updated On : [+date+]
</h4>
</div>
It’s only giving the date of when the parent was created?
Did you include &dateSource=`editedon` in your ditto call? If that does not work you can use the [+editedon+] placeholder in the tlp but you will need another snippet to format the display (like the dateTime snippet) since it is a time stamp. You can also use the snippet above but change the call to :
[!getEditon?&docId=`[+id+]`!]
-
☆ A M B ☆
- 1,231 Posts
Yeah it’s showing the time and date but it’s not showing the date of the latest edited child document... I have a parent doc using a ditto call and 3 child docs that use Jot and FDM. Jot doesn’t actually update the child doc editedon time but the FDM time does change it’s editedon date. It’s showing up in the child editedon call but it’s not being reflected in the parent ditto call that one of it’s child docs has been edited.
Does this make sense? LOL
Could it be cache related? Does the editedon date change if you edit from the manager instead of FDM? I think that NewsPublisher has a setting to force the cache to refresh, not sure if FDM needs this as well.
-
☆ A M B ☆
- 1,231 Posts
I just saved the child doc in the manager and it shows in the child that it was just updated.... cleared the cache in the manager and checked the parent and there’s no update.
:(
-
☆ A M B ☆
- 1,231 Posts
Sorry, I just re-looked at my folder structure. IT may hold clues why it’s not working
OVERALL PARENT
+Sub Parent
+child 1
+child 2
+child 3
+Sub Parent
+child 1
+child 2
+child 3
OVERALL PARENT
Ditto :
[!Ditto? &tpl=`MainMembersPagesTpl` &dateSource=`createdon` &showInMenuOnly=`1` &summarize=`15` &total=`9` &sortBy=`createdon` &sortDir=`ASC` &descendentDepth=`3` !]
MainMembersPagesTpl :
<div class="ditto_item" id="ditto_item_[+id+]">
<h4 style="padding:10px" class="ditto_pageTitle"><a href="[~[+id+]~]">[+author+]’s [+pagetitle+]</a></h4>
<p style="margin-left:10px">Created On : [+date+] || Updated On : [[getEditon? &docId=`[+id+]`]]</p> </div>
Sub Parent
Ditto :
[!Ditto? &tpl=`MembersPagesTpl` &showInMenuOnly=`1` &summarize=`15` &total=`9` &sortBy=`createdon` &sortDir=`ASC` &descendentDepth=`3` !]
MembersPagesTpl :
<div class="ditto_item" id="ditto_item_[+id+]">
<h4 style="padding:10px" class="ditto_pageTitle"><a href="[~[+id+]~]">[+author+]’s [+pagetitle+]</a>
Last Update : [+editedon:date=`%a %B %d, %Y at %H:%M`+]</h4> </div>
Child 1, 2 , 3
No Ditto Calls.
Hope this makes sense.
Oh, I think I now understand what you are wanting. In the structure you provided you want the the sub parent to show when one of it’s children has last been edited, not when itself has been edited. So that when you edit child1, the menu for the sub Parent will know that the the child was updated.
I think this will require a custom snippet to check the edit date of the children and post the most recent.