View Full Version : Repeating Code without cutting and pasting
tucana
04-14-2003, 04:39 AM
On this site of mine,
http://www.ringamoby.com (http://)
I have about 130 pages with links at the left-hand side. This is all very well until I need to change the links. Going through all those pages changing every one is a bit of a pain, as you might imagine!
I don't want to use frames as they upset some search engines. Is there a way I can just have a single link to a piece of text or something on every page and the browser will insert the full set of links at that place whenever the page is loaded?
TIA,
DCElliott
04-14-2003, 06:09 AM
If you have a service provider who supports PHP or ASP you can have your pages "built" at the time they are requested by a user. Where your menu is, you have a piece of HTML pseudo-code that then inserts the menu code. This is the dynamic approach, but requires support by the provider because serving such pages requires more horsepower and thy often make you pay for it.
There is an alternative which does statically what the above do dynamically. You take a very similar approach, writing your code normally but then inserting html pseudocode that points to external files with repeated content like headers, menus, footers, etc. Do a web serach with the keywords html preprocessor. I think one of the most promising freebies is this one (http://www.labyrinth.net.au/~dbareis/ppwizard.htm) . Once you have it set up right, you could regenerate your entire website with a single click.
Good luck.
DE
tucana
04-14-2003, 06:36 AM
That PPWizard looks good... I will try it out.
Thanks,
tucana
04-14-2003, 07:57 AM
OK, I've tried PPWizard - it seems to work fine. However, how do I get my editor of choice, i.e., 1stPage, to understand what *.it and *.ih documents are? They don't show up in the documents sidebar.
I've tried adding those document types to the file filter list in the Options/General Program Preferences, both in the list of all documents and on the individual rows (web pages for *.it and text files for *ih), but they still don't show up.
BoR|S
04-17-2003, 03:27 AM
Well I think it depends on your host, if it supports SSI (Server Side Includes) then you should use shtml files and include the repeating content. There is a good tutorial about using SSI supplied with FP.
If your host supports PHP/ASP/CGI you can use their include functions.
Another solution will be a use of DHTML with CSS, I found a little script (http://www.dynamicdrive.com/dynamicindex3/docsindocs.htm) on Dynamic Drive which claims to work like SSI on non-SSI enabled hosts.
DCElliott
04-17-2003, 04:46 AM
Boris
Good to have you back after a nearly 4 month hiatus. I'll have to check out that script.
DE
BoR|S
04-17-2003, 05:15 AM
Originally posted by DCElliott
Boris
Good to have you back after a nearly 4 month hiatus. I'll have to check out that script.
DE
Thx!
I think I'm back, for some 3 months now... Until I get drafted...
Anyway, I hope I'll have enough time for the forum, I ahve my finals soon... :rolleyes:
tucana
04-17-2003, 05:22 AM
Nice script... Hmm... thanks for the ideas folks.
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.