TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Re: Including content of one file of HTML in another?
Subject:Re: Including content of one file of HTML in another? From:Arlen -dot- P -dot- Walker -at- jci -dot- com To:"TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com> Date:Wed, 19 Dec 2001 15:07:41 -0600
>I do not know if the server she wants to do this on offers Server
>Side Includes or not. She has HomeSite and Dreamweaver at her
>disposal, but would rather not do wholesale search-and-replace
>to make the same navbar change in each of N files in the site.
>
>Any suggestions of where to look?
Easy way to tell is to create an SSI file with an .shtml extension and see
if it works. SSI is by far the easiest way to do this, however, there are
an abundance of other ways.
If it's apache with mod_perl installed, there was an article in an back
issue of the perl journal which did precisely that, used perl to create a
top navbar for the page. This can also be done with PHP, and I believe it's
possible in the later versions of ASP as well. I think you can do it with
Cold Fusion as well, but I'm not to familiar with that and so I could be
wrong there. The advantage of doing this through server-side scripting
rather than via an include is that the navbar can be a little more
intelligent -- it can leave out a navbar link that simply points to the
current page, for example.
It's possible to do something very like this in javascript as well, and
include the javascript. But then you have to face the prospect of all those
people who surf with javascript turned off; if that's your navigation bar,
then you've left them without any means to navigate your site; not a Good
Thing, alas.
Front Page and Dreamweaver (neither one puts out standard-compliant code;
no WYSIWYG tool does -- that's what makes debugging their output so much
fun sometimes) both have facilities which almost do this. I say *almost*
because if you're working on your local machine, then after debugging
uploading to the main server, you'll have to upload the entire site, not
just an include file, because they put the code into each and every
individual html file.
Were it me, I'd do it with a perl script invoked by an "<--include virtual"
SSI command. Neat, clean, all the load's on your server rather than making
the client download the script and it works no matter the browser version.
Have fun,
Arlen
Chief Managing Director In Charge, Department of Redundancy Department
DNRC 224
Arlen -dot- P -dot- Walker -at- JCI -dot- Com
----------------------------------------------
In God we trust; all others must provide data.
----------------------------------------------
Opinions expressed are mine and mine alone.
If JCI had an opinion on this, they'd hire someone else to deliver it.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Collect Royalties, Not Rejection Letters! Tell us your rejection story when you
submit your manuscript to iUniverse Nov. 6 -Dec. 15 and get five free copies of
your book. What are you waiting for? http://www.iuniverse.com/media/techwr
---
You are currently subscribed to techwr-l as: archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit http://www.raycomm.com/techwhirl/ for more resources and info.