Hi,
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)?
Thanks,
Ankur
Hi,
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)?
Thanks,
Ankur
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.
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 ![]()
If you are using freemarker then see: