Jump to content
Sign in to follow this  
Tass

Dynamic pages

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

well content is what makes up the page.. not how it looks, anyways I just started using php includes which helped out a lot and made my site way more organized for me.

Share this post


Link to post
Share on other sites

Also, the PHP require(somefile.php) function is similar, but if the required file cannot be loaded into the page, it will cause an error instead of just loading without the file.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...