Jump to content

"last updated" note in site footer


topada
 Share

Recommended Posts

Hi everyone,

i just started working with processWire recently. It's an awesome and very powerful cms. I'm currently working on my father's site: relaunch.skulptour.eu for which i used ryan's basic blog profile and adapted it to my needs. Yet it's all developing quite well and fast.

today i though i'd like to have a small info paragraph at the very bottom of the footer - something like "last updated 14. January 2014". i know that i can set date fields, just like in the blog posts, but isn't there a smarter way? maybe there are some PW internal functions i can call?

i'd appreciate to hear some of your ideas!

-- topada

Link to comment
Share on other sites

I think something like this should do what you want:

echo date("j. F Y", $pages->get("sort=-modified")->modified);

It finds the last modified page. You can of course change this to created and also limit to various templates, parents, etc if you want.

  • Like 6
Link to comment
Share on other sites

Adrian's code shows you the date of the last updated page in the site (which may or may not be the current page being viewed). If you instead want to show the date that the current page being viewed by the user was last updated, you'd do this instead:

echo date("j. F Y", $page->modified);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...