liam_davison
I'm new here

Automatically setting metadata variables from #global objects

Hello,

I've been asked to automatically set some values in the page metadata. Specifically, for each page/node I need to know:

  • The date the page was last updated (I think this can come from #global.page.changeDate)
  • The date the page was first created
  • The date the page was published to the site (perhaps based on #startdate ?)
  • The date the page was released/approved

Are #global variables available for first created, date published, and date released?

I am assuming that I can use Rules to automatically set some values in the page's metadata, probably <ONRELEASE>. Is this correct?

Many thanks,

Liam Davison

0 Kudos
2 Replies
Peter_Jodeleit
Crownpeak employee

You want to write these information into the generated html page, is this correct?

If so, here are my suggestions:

  • The date the page was last updated (I think this can come from #global.page.changeDate)

When a page is generated you always work with a released version, so the last change date is the release date. So you could either use getRevision() or getReleaseRevision().

  • The date the page was first created

There is no such build-in property, so this information has to be stored manually. E.g. a CMS_INPUT_DATE field in the page with the option preset="CREATED" and which is not editable.

  • The date the page was published to the site (perhaps based on #startdate ?)

I unsure what you've got in mind here. You mean something like "first published"? This is also no build-in property. But publishing is normally done hand in hand with releasing. So you could integrate a logic for "first release" in your release process.

  • The date the page was released/approved

See point one above.

Hope this helps.

Peter

Hello Liam,   

do you need further help or did Peter's reply already help you? If so, it would be great if you marked

his reply as "correct answer" so that other community users find the solution easily. If you have

already found a solution by yourself, it would be very kind of you, if you posted it here.   

Best regards 

Michaela

0 Kudos