Forum

Copyright text in f...
 
Notifications
Clear all

Copyright text in footer with Dynamically updated current year.

2 Posts
2 Users
0 Reactions
27 Views
Posts: 5
Topic starter
(@mrileykartoonstudios-com)
Member
Joined: 5 months ago

Hi, I see how to add copyright text using custom CSS, but from what I understand the current year can't be dynamically updated and that would be something a customizable html would do, but I don't see that in themes and I saw nothing in downloadable plugins that would do that. If anyone has done this, could you tell me how it's done please? I'm a systems admin and not much of a web coding guru to say the least. 

 

Here's what I did in Custom CSS. Disabled the OS Ticket logos and added this copyright:

#footer #osticket a,
#footer #ostawesome a {
display: none !important;
}

#footer:after {
content: "Copyright Β© 2006-2026 Our Company Name. All rights reserved.";
display: block;
text-align: center;
font-size: 14px;
margin-top: 10px;
color: #777;
}

So basically achieve the above but 2026 gets automatically updated to 2027 next year and so forth. 

Thanks. 


1 Reply
Posts: 1177
Admin
(@stevland)
Member
Joined: 2 months ago

You're right that CSS content can't pull in dynamic values like the current year. But osTicket Awesome includes a file specifically for custom JavaScript: osta/js/user-scripts.js

Keep your existing CSS to hide the default footer links, then add this snippet to user-scripts.js:

javascriptdocument.addEventListener('DOMContentLoaded', function() {
var footer = document.getElementById('footer');
if (footer) {
var copy = document.createElement('div');
copy.style.textAlign = 'center';
copy.style.fontSize = '14px';
copy.style.marginTop = '10px';
copy.style.color = '#777';
copy.textContent = 'Copyright \u00A9 2006-' + new Date().getFullYear() + ' Our Company Name. All rights reserved.';
footer.appendChild(copy);
}
});

Then remove the #footer:after rule from your Custom CSS since the JS handles that part now. Keep the rule that hides the default links.

The year will update automatically every January 1st.


Reply
Posts: 5
Topic starter
(@mrileykartoonstudios-com)
Member
Joined: 5 months ago

Thank you very much for you help. I'll do that πŸ™‚


Reply
Share: