Web page design "templates"

hi guys

im makin a site for a friend of mine. its got fricking loads of pages cos hes a photographer and has lots to show… now ive done about 30 pages, probably got another 90 to do…  now ive realized that i want to add some info on ALLL the 30 i already done… so wanna know if theres a way to get around this problem if i encounter it again…

so, is there a way to make a “template” page and add new data to it and make loads of these “different” pages… but if you change something on the telpate part of the page the WHOLE lot change. sa y if youve made 50 pages and u wanna put an email address at the base of the page or a new link on the side… can you do it to just one and the whole of them change??

any help would be great!

Finally got round to looking mate, hah sorry for the delay!



A template is something you start with at the very beginning before doing anything (if your whole site is going to be based on the same design and layout). Unfortunately, there is no easy way of mass editing portions of your site once its done, you will need to go into each individual page and change anything (unless you have coded it using CSS with i doubt you have).

If you’re clever enough you could write a script to replace the HTML in each page. It’s only text so it would’t be hard to do.


What bouffant said.



Unix is particularly good for this, with a big of regex no problem. Tho that probably doesn;t help you if you were doing this all with single pages anyway.



What I do is create two php files (they only actually contain html) one called header, one called footer.



Then when I create a new page I add a very simple php ‘include’ command (one line) that basically says ‘put contents of header.php here’ and footer.php here.



Header and footer natch contain the site menu, logo, footer links blah blah. That way if I need to add something to the menu, or an email at the bottom etc just a case of editing one file.



I can send you examples if you want.

[quote]bangthedj (05/08/2010)[hr]What bouffant said.

Unix is particularly good for this, with a big of regex no problem. Tho that probably doesn;t help you if you were doing this all with single pages anyway.

What I do is create two php files (they only actually contain html) one called header, one called footer.

Then when I create a new page I add a very simple php ‘include’ command (one line) that basically says ‘put contents of header.php here’ and footer.php here.

Header and footer natch contain the site menu, logo, footer links blah blah. That way if I need to add something to the menu, or an email at the bottom etc just a case of editing one file.

I can send you examples if you want.[/quote]

now that sounds interesting… yes please btdj! thanks guys!! informative!

can you do these “header and footer” things for the sides of a page? i know it aint the header or footer but i have my links and navigation links on the left side. possible, or odes it only work for the top and bottom of a page?

BANGTHEDJ! you are da man! haha had alook online about the php thing and worked out how to include it anywhere i wanted on the page using my tables…

thank you allll so much for the info! youve all been a massive help! no more changing EACH AND EVERY PAGE! :D:D:D:D:D:D:D:D

after readin that helpful bit of info about using php files ive found out that i nead to access the htaccess file so that i can use php within html files…

read a few things about viewing it via filezilla which i use. but i cant seem to find it on my mediatemple server. where abouts is it located. everyone says its in my site root folder but i cant see it… am i looking in the wrong place?