Mobile app version of vmapp.org
Login or Join
Annie201

: 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,

@Annie201

Posted in: #Template

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

2 Comments

Sorted by latest first Latest Oldest Best

 

@Murray155

Ya. John is right. Please refer here for more info php.net/manual/en/function.include.php

10% popularity Vote Up Vote Down


 

@Sarah324

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme