Click to See Complete Forum and Search --> : Can a CCS be used for this...? If not, can you point me in the right direction?
psraff
05-05-2003, 11:55 AM
I know CCS can be used to change how your page looks. I will be using it in making the background the same on all pages of the web site and so forth. But now here is my question. Lets say for example, I have the same email link on each page. If that email path changes, I don't want to go to every page and change it. I want to go to one file, make the change and have it reflect to all pages in the site. What do I use to do that? Along the same lines, I would like to have the same links section at the top of each page. (have buttons to press to go to all the other pages on the site) If I want to add a new button, I would like to add it to one file and have it appear on all pages. What can I use to acheave this?
Thanks!
George in TX
05-05-2003, 04:59 PM
The only reliable way to do this is server-side. It can't be done client-side that I know of, and while CSS is a great tool for presentation it won't do this job either.
See this site:
http://www.htmlhelp.com/faq/html/design.html#include-file
psraff
05-05-2003, 05:07 PM
Thanks... Bad news is they don't support ASP or SSI files on their non commerial host server. So I may have to cheat and use frames for the top of each page. As much as I don't want to...
Thanks again.
JackTheTripper
05-05-2003, 06:06 PM
You could put the link in an external .js file then just update that if the address changes
<!-- this goes in the head. Change the word 'external' to your file name -->
<script language= "javascript" src= "external.js"></script>
the javascript file would be
function writeEmail() {
document.write('<a href= "mailto:you@yourdomain.com">')
}
Then put this in your page where you want the e-mail link...
<p>Please e-mail us at <script>writeEmail()</script> and we will get back to you.</p>
Someone please correct me if I'm wrong.
DaiWelsh
05-06-2003, 05:44 AM
That would work but seems a little overkill to me, surely an editor with search/replace functionality across multiple files is a much better direction to take (assuming you dont solve the lack of server-side functinality)? Or am I missing something?
Dai
AdamGundry
05-06-2003, 09:54 AM
Agreed - don't use Javascript for tasks like writing content unnecessarily. That code may speed your job up slightly, but it makes the page inaccessible to those with JS disabled (about 10% of web users). JS is _not_ a substitute for server-side includes.
Adam
Using templates in software like Dreamweaver does the job too!!
luds