By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Updating repetitive statements in many documents

P: n/a
I didn't know what exactly to put for the subject of this message, but
here is my problem: I have about 10 .htm files - index.htm, resume.htm,
etc. In each of those files, right after <body>, but before anything
else, I have the following:
<div id="item1" href="index.htm">Home</a>
<div id="item1" href="resume.htm">Resume</a>
....and so on

The problem is, I keep updating these div tags, and when I update it one
file, I have to do it in all the files. Is there an easy way to store
this information (the div tags) in one file and then somehow include/call
it from other files?

Hope this makes some sense...

Thanks,
Ross
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Ross K Thomas <kr*******@despammed.com> wrote:
Is there an easy way to store
this information (the div tags) in one file and then somehow
include/call it from other files?


You question is a variant of "How do include one file in another?",
which is answered in the FAQ:
http://www.htmlhelp.com/faq/html/des...l#include-file

My recommendation is: Do not include "standard navigation" but a link
to the main page, which contains suitable navigation. But if you do,
make it so small and design it so well that you will not have need to
change it.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

P: n/a
Ross K Thomas <kr*******@despammed.com> wrote:
The problem is, I keep updating these div tags, and when I update it one
file, I have to do it in all the files. Is there an easy way to store
this information (the div tags) in one file and then somehow include/call
it from other files?


Use a "include one file in another" method as suggested, or use a multi
file/directory wide search & replace, any decent editor ought to have
multi line s&r (sadly few do).
Headless

--
Email and filter list: http://www.headless.dna.ie/usenet.htm
Jul 20 '05 #3

P: n/a
In article <Xn**********************************@130.133.1. 4> in
comp.infosystems.www.authoring.html, Ross K Thomas <kr-
us****@despammed.com> wrote:
I didn't know what exactly to put for the subject of this message, but
here is my problem: I have about 10 .htm files - index.htm, resume.htm,
etc. In each of those files, right after <body>, but before anything
else, I have the following:
<div id="item1" href="index.htm">Home</a>
<div id="item1" href="resume.htm">Resume</a>


A couple of people have mentioned FAQs on including one file in
another, but I haven't seen anyone point out an important error: You
have two different tags with the same id. This is not allowed.

You've also omitted the starting <a> tags and the ending </div>
tags.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #4

P: n/a
Stan Brown wrote:
In article <Xn**********************************@130.133.1. 4> in
comp.infosystems.www.authoring.html, Ross K Thomas <kr-
us****@despammed.com> wrote:
<div id="item1" href="index.htm">Home</a>
<div id="item1" href="resume.htm">Resume</a>


A couple of people have mentioned FAQs on including one file in
another, but I haven't seen anyone point out an important error: You
have two different tags with the same id. This is not allowed.

You've also omitted the starting <a> tags and the ending </div>
tags.


Also, if "index.htm" is the default index file for that directory, I
would link to it with href="./" instead of href="index.htm", so that the
cleaner URL ending in a slash is used (the way the user probably got
into the site in the first place) instead of adding an additional cache
and history entry for the URL ending in "index.htm".

I'd also use the more-proper .html extension for HTML files rather than
the bastardized Microsoftism ".htm", but that's just a personal
aesthetic preference.

--
== Dan ==
Dan's Mail Format Site: http://mailformat.dan.info/
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/

Jul 20 '05 #5

P: n/a
Stan Brown <th************@fastmail.fm> wrote:
My own esthetic preference is for shorter URLs, which means that by
my standards .htm is slightly better than .html. No extension at all
would be better still, of course, but that takes extra work in
setting up the server.


And would confuse users, when they see the URL and maybe have to type
it by hand or at least copy & paste. People are _used_ to seeing .html
(or sometimes .htm) at the end of a URL that refers to an HTML
document. This, by the way, is in my opinion the strongest argument in
favor of preferring .html to .htm. (And in my serious, though probably
not serious-sounding, opinion, the strongest argument in favor of .htm
is that it does _not_ correspond to the abbreviation HTML and
specifically leaves out the letter that means 'language'.)

In an ideal world, URLs would normally have no "extension" parts.
(And in an ideal world, we would have URNs in addition to URLs
at our disposal.) A URL would simply refer to a resource, like
<http://info.foo.example/cv>, and the server would look at the
Accept header (in the HTTP request) and check the information about the
formats in which the document exists on the server, and choose the best
version and send it. Whether the alternative formats are also available
via specific URLs, like <http://info.foo.example/cv.txt>,
<http://info.foo.example/cv.pdf> and <http://info.foo.example/cv.htm>,
would be less relevant.

But in the current world, which is slightly less perfect than ideal,
using the "extensions" that are most commonly used by others is almost
always the best practice. People who read this group, at least the
regulars, know that the difference between ".htm" and ".html" is
exactly the letter "l". But the prejudices, misconceptions and
connotations that other people have are part of the reality we live in.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #6

P: n/a
Tim
On Sun, 3 Aug 2003 21:49:51 -0400,
Stan Brown <th************@fastmail.fm> wrote:
My own esthetic preference is for shorter URLs, which means that by
my standards .htm is slightly better than .html. No extension at all
would be better still, of course, but that takes extra work in
setting up the server.


My opinion is that short suffixes are a pain (no suffixes for resource
requests is more sensible, at least on the WWW), but for more technical
reasons: There's only so many combinations of letters which can be used
to create meaningful suffixes, when you only have three letters to use.
At some stage, you're going to get some file format wanting to use three
letters, because they're related to the file format, but they're already
in use (e.g. .bin, .doc, .rpm, etc., all have multiple, and
incompatible, uses).

--
My "from" address is totally fake. (Hint: If I wanted e-mails from
complete strangers, I'd have put a real one, there.) Reply to usenet
postings in the same place as you read the message you're replying to.
Jul 20 '05 #7

P: n/a
In article <Xn*****************************@193.229.0.31> in
comp.infosystems.www.authoring.html, Jukka K. Korpela
<jk******@cs.tut.fi> wrote:
Stan Brown <th************@fastmail.fm> wrote:
My own esthetic preference is for shorter URLs, which means that by
my standards .htm is slightly better than .html. No extension at all
would be better still, of course, but that takes extra work in
setting up the server.


And would confuse users, when they see the URL and maybe have to type
it by hand or at least copy & paste.


Yet your own pages don't use any extension. I'm thinking for example
of <http://www.cs.tut.fi/~jkorpela/math/>. Does this _really_
confuse users? Somehow I doubt it.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #8

P: n/a

Regarding extensionless URLs:

"Jukka K. Korpela" <jk******@cs.tut.fi> writes:
Stan Brown <th************@fastmail.fm> wrote:
My own esthetic preference is for shorter URLs, which means that by
my standards .htm is slightly better than .html. No extension at all
would be better still, of course, but that takes extra work in
setting up the server.


And would confuse users, when they see the URL and maybe have to type
it by hand or at least copy & paste. People are _used_ to seeing .html
(or sometimes .htm) at the end of a URL that refers to an HTML
document.


Not sure about that. People are used to seeing .htm or .html. But
they're also used to seeing naked URLs, with or without a trailing /
for directory default pages.

Having recently gone through the pain of moving a site from a static
..htm scheme to an extensionless scheme masking a .php extension, I
don't want to repeat the work when I next change server side
representation!

--
Giles Chamberlin

Jul 20 '05 #9

P: n/a
J> using the "extensions" that are most commonly used by others is
J> almost always the best practice.

Indeed, I browse from wwwoffle "lasttime online" lists. All is fine
until one gets to the pages from some snob site where one can't tell a
tiny graphic from a treatise by the filename.
Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.