Entrance Events! Chat Gallery Search Everyone Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
April 06, 2025 - @557.08 (what is this?)
Activity rating: Three Stars Posts & Arts: 44/1k.beats ~ Boop! The forum will close in 443.beats! Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts Start New Topic  Submit Art
News: :ha: :pc: Hello Melonland! :pc: :happy: Super News: Upload a banner!

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Is there an easier way of updating footers?


« previous next »
Pages: [1] Print
Author Topic: Is there an easier way of updating footers?  (Read 1880 times)
Icey!
Sr. Member ⚓︎
****


My posts are so cringe

⛺︎ My Room

View Profile WWW

Great Posts PacmanFirst 1000 Members!Pro Bug Finder!OG! Joined 2021!High Speed Ozwomp!
« on: January 06, 2022 @918.23 »

A few days ago we entered the year of 2022, but one problem was that I had to update my copyright date from 2021 to 2022 on every page. Is there an easier way of doing this where I could just update it once to effect every page?
« Last Edit: January 06, 2022 @919.83 by Icelogist » Logged



:ozwomp: my beloved

Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Hyperactive DonutGreat Posts PacmanOfficially DogThanks for being rad!a puppy for your travelsAlways My Pal
« Reply #1 on: January 06, 2022 @951.61 »

A good question! You can apply this to anything you want across a site not just footers :grin:
Although, on the point of copyrights, I'm of the opinion that those are a feature of corporate websites and are not needed on personal sites, each to their own though!

To answer your question, if you use a static site generator you can do this pretty easily - Although I cant help much with that.

If your not using a site generator, include a script at the end of each page that updates the footer, then you just have to update the script to update every page. Its very fast to load, the downside is it does not update if people have scripts turned off.
HTML
Code
<footer id="foot">:grin:efault footer text for people without scripts</footer>
<script src="footUpdate.js?v=0"></script>

Script
Code
var footText = "&copy; 2022 - My Rad Site";
var foot = document.getElementById( 'foot' );

window.onload = function() {
 foot.innerHTML = footText;
}

OR You could also put an iframe in your footer to a default footer page. This is a bit slower as it needs to loads multiple pages (your main page and the footer page) but it still works if people have scripts turned off.
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
di
Full Member ⚓︎
***


she/her

⛺︎ My Room
RSS: RSS

View Profile WWW

Great Posts PacmanFirst 1000 Members!OG! Joined 2021!
« Reply #2 on: January 07, 2022 @32.43 »

Super helpful, thank you Melon :cheesy:
Logged

Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Hyperactive DonutGreat Posts PacmanOfficially DogThanks for being rad!a puppy for your travelsAlways My Pal
« Reply #3 on: January 07, 2022 @56.67 »

OH ALSO, if you want the year to update itself every year you could do:

Code
var year = new Date().getFullYear();
var footText = "&copy; " + year + " - My Rad Site";
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

Different ways to say «I love you»

Started by devilsBoard ⚚ ∙ Life on Earth!

Replies: 7
Views: 956
Last post October 17, 2023 @739.38
by keybladekid6
best ways to go about a website with image based containers?

Started by morrysillusionBoard ☔︎ ∙ I need Help!

Replies: 2
Views: 983
Last post January 10, 2023 @59.16
by morrysillusion
Your favourite ways to socialise offline

Started by Deckade (Tolo)Board ☞ ∙ Life on the Web

Replies: 3
Views: 1283
Last post January 23, 2023 @707.48
by Corrupted Unicorn

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi