Jump to content

Dynamic pages


Tass

Recommended Posts

I'm quite new to html was wondering something. I started my template and that is done. I started creating content and realized what if I wanted to change something.. I'd have to go through all the pages and manually change them one by one.. What if I had hundreds of pages? It was going to take forever.. is there a way I can do this? I'v looked around, but I'm not completly sure. If someone could point me in the right direction, that would be nice.

Link to comment
Share on other sites

I'm quite new to html was wondering something. I started my template and that is done. I started creating content and realized what if I wanted to change something.. I'd have to go through all the pages and manually change them one by one.. What if I had hundreds of pages? It was going to take forever.. is there a way I can do this? I'v looked around, but I'm not completly sure. If someone could point me in the right direction, that would be nice.
Depends on exactly what you're trying to do. If you're trying to standardize, say, a header, than the best way to do it is with server-side-include, in your favorite server-side language.If you can't use server-side, you can use javascript to write it into your file, though that becomes annoyingly verbose really fast.//Matt
Link to comment
Share on other sites

I cannot use SSI or ASP on the current server I'm using.
Your only hope is javascript. What you do is convert the HTML you want to to keep constant throughout pages into javascript by writing it with document.Write(). Turn your code into a function, then put the function in a .js file, include it in the head tag of whatever pages you need the content in. Then just call your function in the document wherever you need the content (instead of directly copying the content). Now, when ever you need to change that content, simply edit your javascript function.//Matt
Link to comment
Share on other sites

I started creating content and realized what if I wanted to change something.. I'd have to go through all the pages and manually change them one by one..
The so-called "content" here as you say is the appearance or template exactly ( CSS or Javascript ... )certainly , everyone must change the content of pages when needed :)
Link to comment
Share on other sites

If you are able to use PHP that would be the best. Then you could just use this code:<html><head><title>your title</title></head><body><?phpinclude("ForExampleMyBanner.php")?>And here's e.g the article</body></html>And just use that code on each site, and if its a banner you use in there, you could just change the banner url in that file, and it would change on all of your sites that got the include PHP code.

Link to comment
Share on other sites

If you want a way to do it without using any codes, open all files on dreamwearer (if you have it) or another program that has a find and replace function.go edit > find and replace select all open documents and then put in your current code and the one you want to replace it with. Make sure you use a peice of code that is not going to change something you don't want to change.this is the best way if you don't have server-side scripting.Unless you included a javascript file with all the variables on it using '<script>' and then your page wrote those variables. I don't think you can use it for everything though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...