Updating heaven

Mattduk

New Member
Hey all. I'm new here and this is my first post.

I'm a relative beginner and I was asked a question by a friend with regards to a design problem he has.

Problem

Basically, he wants to have a link or a body of text on the bottom of all his pages, which is not actually on the html page itself. He wants it seperate in order to be able to update it once and all the pages receive the update. I guess kind of like how a css page can be updated and the entire site using it will be updated in one fail swoop.

Can anyone suggest a way of doing this? Can you put content in a css file that will appear on any pages using it? How else could this be done?

Thanks in advance, and if I haven't been clear, feel free to ask questions.

Cheers

Matt.
 

StephanieCordray

New Member
yes you can add content parts to your css.

After you've made a class for the content, just add the content as one of the attributes of the class.
 

NeXus

New Member
I think you can do it by adding the css "content" property to the class as mentioned. This is probably the easier way for an existing site.

Another way to do it is to have a single template file with your header and footer, have the page content in separate files then include them into the template via php or other server-side scripting language.

Eg. on my site I have:

Template for entire site
index.php
style.css​

Content pages (contain html, only the middle part of the webpage)
one.txt
two.txt
three.txt​

In the site navigation links I have:

a href="index.php?page=one"
a href="index.php?page=two"
a href="index.php?page=three"

The php script in index.php looks at the query string (the page=one bit) and includes the relevant page.

This way there is no code at all that is duplicated across the site. You can't do that with the css option which kind of includes things the other way round.

Ask if u want further explanation.
 
Top