Dynamic Copyright Footer Text Year

Tips submitted by ASP.NET Maker users
Post Reply
xgis
User
Posts: 68

Dynamic Copyright Footer Text Year

Post by xgis »

Copyright years in footer text are usually updated manually. To make them automatically update each year without regenerating the application a simple script can be used.

Two examples below. One shows copyright based on a year range and one on a single year. Simply copy and paste into the footer text field on the HTML > General tab > Footer text

Single Year eg Changes to current year automatically:
&copy;<script>document.write(new Date().getFullYear())</script> Your Company Name. All rights reserved.

Year Range Example:
&copy;2010-<script>document.write(new Date().getFullYear())</script> Your Company Name. All rights reserved.

Just set it and forget it!


xgis
User
Posts: 68

Post by xgis »

To add some extra functionality and have the footer include a URL redirect link to your web page do the following in the Footer Text....

&copy;<script>document.write(new Date().getFullYear())</script> <a href="https://www.yoururl.com" target ="_blank">Your Company Name</a>. All rights reserved.

This opens a new tab in the browser so your database editing application remains unaffected.


Post Reply