Automatically update online copyright year

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
YE-TW
Propeller Head
Posts: 23
Joined: Mon Jun 11, 2018 3:30 am

Automatically update online copyright year

Post by YE-TW »

Hi,

Our footers (Side Nav) currently use the copyright year variable that updates automatically every year (© yyyy), but this means that we need to manually repost all of the content on our website every year just because the year changes.

I'd like to change the master page, so that the copyright year on our live website updates automatically on January 1st, without any manual intervention.

I was thinking of adding javascript or similar to the master page, for example:

Code: Select all

<script>document.write(new Date().getFullYear());</script>.
How would I add this to the master page?

Alternatively, I'm open to any suggestion on how to get the footer in our live website to update the copyright year automatically. We host on Google Cloud Platform, if that matters.

Thanks in advance!
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Automatically update online copyright year

Post by NorthEast »

YE-TW wrote: Wed Jan 31, 2024 3:20 am but this means that we need to manually repost all of the content on our website every year just because the year changes.
But you don't need to republish websites or documents if the only change is the date.
The copyright indicates when the content was created, so if you wrote/published it in 2023, then you just leave it as "copyright 2023" forever - until you make changes to the content and republish it.

You can copy and paste the script in your template/master page (in Text Editor mode) - just put it wherever you want the date.
YE-TW
Propeller Head
Posts: 23
Joined: Mon Jun 11, 2018 3:30 am

Re: Automatically update online copyright year

Post by YE-TW »

Hi Northeast,

Yes, you are correct in that we don't "need" to update the copyright year, but our product managers want us to do so in our landing pages

I tried pasting the script in the .flmsp, but nothing is generated. Flare ignores it. That's why I'm asking for help.

TIA

Best regards,
Yael
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Automatically update online copyright year

Post by NorthEast »

I already tried your script and it works fine for me in a master page. I switched to Text Editor view, then pasted it in the body of the page where I wanted the date to appear...

Code: Select all

<p>The year is: <script>document.write(new Date().getFullYear());</script></p>
Or if you were in XML Editor view and used Insert > Script, then you just enter the script itself without the <script></script> tags.
YE-TW
Propeller Head
Posts: 23
Joined: Mon Jun 11, 2018 3:30 am

Re: Automatically update online copyright year

Post by YE-TW »

Hi NorthEast,

Yesterday, it didn't work, and, voila, today it does work. Perfectly.

Thanks!
trent the thief
Propellus Maximus
Posts: 613
Joined: Wed Feb 01, 2006 6:21 am
Location: Off in the dark....

Re: Automatically update online copyright year

Post by trent the thief »

Consider using a variable to hold the years. Then you can update them in one spot to please PMO whenever they decide they need something different.
Trent.

Certifiable.

Image

umm...
I meant MAD Certified.

Official Propeller Beanie Owner :-)

:flare: Are you on Flare's Slack channels? PM me for an invitation! :flare:
YE-TW
Propeller Head
Posts: 23
Joined: Mon Jun 11, 2018 3:30 am

Re: Automatically update online copyright year

Post by YE-TW »

Thanks, Trent the Thief,

We do use a variable, which is fantastic.

The issue is that we usually don't update the online docs until the next release, which might be in Q2. The powers-that-be want us to update ASAP after January 1st. We are looking for a solution that updates automatically online, so that we don't have to reload the entire site.

Hopefully, the solution that we are now implementing will automatically update the year for us.
Post Reply