Site Menu - Dynamic year

In my website, I have a footer in which I am displaying “© 2022” using site menu. Can I make this year dynamic as a current year in content of site menu($CurrentYear something)?


Could you provide more information about how you are retrieving the 2022 year? Is it hardcoded?

Anyway, you can use Java to get the current year and pass it to Freemarker or even use the .now function in Freemarker itself. Something like ${.now?string('yyyy')} should work.

Hi Nicholas,
Thanks for the reply. I am using hardcoding year. Can we have any special character or something else which we can add in itself in Title section to display the current year? I don’t want to manage this in template file because copyright section’s position can be change.

If you use a user-entered string like the title of a menu item, the content will not be dynamic as it is user-managed. If you want the year to be dynamic, you must manage it yourself with Java or Freemarker outside of CMS user control.

Got it. Thanks for the reply :slight_smile:

If you are using freemarker then see: