Howdy all:
In my footer I have the standard Terms of Use, Privacy Policy, etc. Those links in the footer are displayed using Wayfinder. My goal is if I were to modify one of the documents in the footer, Wayfinder somehow could check if the revision date of the resource is less than x days old and if so place "Updated" next to the document name. Am i asking too much of Wayfinder?
-
☆ A M B ☆
- 24,524 Posts
You need a snippet to determine if the editedon date (a timestamp) is less than today's timestamp minus the number of seconds in x days (86400*$days). Have it return "Updated" if so, or nothing if not. Then you could use that snippet in the rowTpl.
Duh! I am so stupid. I never thought about placing a snippet in the template. How easy can that be???!! Thank you so much for your help.
I don't think Wayfinder sets those placeholders.
BTW, if you want the creation date, you might want 'createdon' rather than 'publishedon'.
I chose publishedon rather than createdon just in case I did create a document which I chose not to publish immediately. So is there a work around to pass the publishedon/editedon fields to my snippet?
By default, unpublished docs wouldn't show anyway, so createdon would be more accurate -- unless the publication date is actually what you want (though in that case, I would change the name of the property to avoid confusing myself later

).
What version of Wayfinder are you using? It looks like I was wrong:
Since version 2.3.0 you can use placeholders for all fields of a Resource, such as [[+introtext]], [[+menutitle]], [[+published]], etc.
You might try using them without the wf. prefix.