: Lots of repeated code in website? I'm a playing around with website building by following the tutorials of user "createthenet", a.k.a. Timothy, on YouTube. The steps to follow are simple enough,
I'm a playing around with website building by following the tutorials of user "createthenet", a.k.a. Timothy, on YouTube. The steps to follow are simple enough, but I notice that what he often does is begin with a template, then build pages off of that template.
Not to advertise on his behalf, but I'll use his site as an example. When I click on "Welcome", "About", "Tutorials", etc., most of the site, such as the header area, remains the same.
This saves work when building the site, but suppose I had 50 pages all with the same header area. Then if I decide to change the header area. I'd have to modify 50 files.
Is there a better way of achieving this so that I can modify the header in one file, and it'll be reflected in the other 49?
More posts by @Annie201
2 Comments
Sorted by latest first Latest Oldest Best
What you're looking for is generally referred to as an "include". Server side programming languages like PHP and others offer this functionality. All you have to do is create a header or footer file with the common code on it and then "include" it into each page you want to use it.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.