How Do I add last updated page information
Hi,
I need to get last page update information (date and time) to append at the end of the page (i.e footer). Can you please help me in this.
Thanks & Best Regards,
Uthman
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Wing Ming Chan on 07 Sep, 2015 12:43 PM
Hi Uthman,
Which type of formats are you working with: Velocity or XSLT?
The reason why I asked is that you can pull page information from the index block calling-page, but depending on what type of format you have, the information you want is processed differently.
Additional question: can you handle Java objects (like
Date
), or can you handle Xalan extension?Wing
2 Posted by usmanehsan0613 on 08 Sep, 2015 05:07 AM
Hi Wing
I am working with XSLT format.
From index block what argument name should i use to fetch last updated date information. e.g current-page/start-date , current-page/end-date under meta data tab of page.
I can handle C# Date objects as my site is running on IIS.I guess installing JVM would require several other configurations.
Please advise
Thankyou
3 Posted by Ryan Griffith on 08 Sep, 2015 12:30 PM
Hi Uthman,
Using a Calling Page Index Block, you can use this example XSLT format as a starting point; just remove the link and leave the date bits and you should be good to go. Here is a Velocity version of this Format that uses a Calling Page Index Block.
Alternatively, if you wanted to use Velocity, you could use
$currentPage.lastModified
and the Date Tool to format the date:Please let me know if you have any questions.
Thanks!
4 Posted by Wing Ming Chan on 08 Sep, 2015 12:33 PM
You can use
system-page/last-modified
(a timestamp). In _common:formats/include, there is a format named format-date that you can use to format the timestamp, or you can use my java-time-methods library to do the same thing.Wing
5 Posted by Ryan Griffith on 08 Sep, 2015 01:27 PM
Hi,
For reference, here is the format-date XSLT Format include Wing mentioned in-case you don't have it.
6 Posted by usmanehsan0613 on 09 Sep, 2015 05:43 AM
Thanks Wing and Ryan for your support.
First i am not able to fetch last-modified value ... here is the format i am using ..
<!---->
/xsl:stylesheet
as suggested by Ryan ( this example XSLT format).... Display name is coming fine but last-modified date is blank.
Can you please suggest, whats wrong in the format.
Many Thanks
Uthman
7 Posted by usmanehsan0613 on 09 Sep, 2015 06:05 AM
I selected system metadata and now getting the last-modified value.
But everytime i do publish the page it picks up publish date not when the content was edited.
Is it possible to get the last-modified date of content not the publish date. ?
Looking forward
Many Thanks,
Uthman
8 Posted by Ryan Griffith on 09 Sep, 2015 03:47 PM
Thank you for the follow up, Uthman, glad to hear you were able to access the date by including the system metadata in your Index Block.
Strange, using
last-modified
should definitely give you the last modified date and not the last published date, which would belast-published-on
. Can you confirm you are not usinglast-published-on
?Thanks
9 Posted by usmanehsan0613 on 10 Sep, 2015 04:06 AM
Hi Ryan,
I tried again with content edited , Its giving me last modified date for content.
Thanks for your support
Regards,
Uthman
usmanehsan0613 closed this discussion on 10 Sep, 2015 04:06 AM.