In AEM content page, there is a footer which shows the copyright with “year”. We want to auto-update copyright “Year”. Currently, we are authoring footer year in the authoring dialog. I know we can achieve on the client side, is there any way to achieve the same on the AEM server side?
Views
Replies
Total Likes
Hi,
In java side you can populate year as below and use that in the footer.html/.jsp
int year = Calendar.getInstance().get(Calendar.YEAR);
Note: This requires dispatcher cache to be cleared and top of any additional cdn cache your site may have to reflect the latest year
Hope this helps!
Views
Replies
Total Likes
I thought the same, but I am seeing two issues -
1. Currently, We are authoring the "Copyright © 2017 ARCT Corporation" in Rich Text editor, which I am displaying in HTML. Now, how to break this string and append year(from java class) as you mentioned because "year" is in-between the String, after "Copyright © "?
2. And how do we ensure that that author can author rest of the part in Rich text editor except year?
Views
Replies
Total Likes
In that case you need to redesign your page footer. You need to define clearly which part can be authored, and which part is managed / created / authored by AEM itself. At least that would be the cleanest way.
Do you maintain the page footer per page? Why don't you maintain it centrally -- once for all pages?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies