Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arunkarthik 2 posts 22 karma points
    May 22, 2013 @ 08:15
    Arunkarthik
    0

    Show last updated date in umbraco

    I want to display last updated date in umbraco 4.7

    Say if i even make a small change in content from the admin panel, it has to pull the updated date so that i can show that in footer of the website dynamically.

    Thanks.

  • Owen 123 posts 246 karma points
    May 22, 2013 @ 09:10
    Owen
    0

    1) Create a property to store the last updated date, you can add it to Root item

    2) Handle the content update event(i.e New, Save, Delete..). Create a class that inherit from ApplicationBase.

    public class SaveUpdateDate : ApplicationBase
    {
        public SaveUpdateDate()
        {
            Document.New += new Document.NewEventHandler(Document_New);
            Document.AfterSave += new Document.SaveEventHandler(Document_AfterSave);
        }
    
        void Document_AfterSave(Document sender, SaveEventArgs e)
        {
            //Save 
        }
    
        void Document_New(Document sender, umbraco.cms.businesslogic.NewEventArgs e)
        {
    
        }
    }
    Another option is traverse all the node to find the latest updated date.
  • Arunkarthik 2 posts 22 karma points
    May 22, 2013 @ 09:26
    Arunkarthik
    0

    Hi thanks for the reply,

    I'm just a beginner in umbraco.. can you exactly tel me how to add the property to root item.. and where do i add this code??

Please Sign in or register to post replies

Write your reply to:

Draft