Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 14th, 2007, 03:35 PM
lg
Guest
 
Posts: n/a
Default Include another html file/content

My site consists of many htm pages and each has a banner with my address and some
graphic.

Now each html page is something like this:
<html>
blah blah
<div>
my logo
my address
</div>
here comes to rest of the page
blah blah
</html>

So when I want to change my address or logo graphics I have to go through every
html page and make the changes.

What I would like is to a sperate page for the banner/logo:
banner.htm:
<div>
my logo
my address
</div>

and all the html page would have
<html>
blah blah
INCLUDE BANNER.HTM
here comes to rest of the page
blah blah
</html>

Is this possible with html or css? Or in a compatible way?
  #2  
Old August 14th, 2007, 05:15 PM
John Hosking
Guest
 
Posts: n/a
Default Re: Include another html file/content

lg wrote:
Quote:
>
What I would like is to a sperate page for the banner/logo:
banner.htm:
<div>
my logo
my address
</div>
>
and all the html page would have
<html>
blah blah
INCLUDE BANNER.HTM
here comes to rest of the page
blah blah
</html>
>
Is this possible with html or css? Or in a compatible way?
Not with just HTML or CSS, but yes, it's possible. Take a read through:

http://www.htmlhelp.com/faq/html/des...l#include-file
http://allmyfaqs.net/faq.pl?Include_one_file_in_another

--
John
Pondering the value of the UIP: http://blinkynet.net/comp/uip5.html
  #3  
Old August 15th, 2007, 07:35 AM
Steve Swift
Guest
 
Posts: n/a
Default Re: Include another html file/content

Is this possible with html or css? Or in a compatible way?

Depending on the nature of your header, you could include it all in one
image, and use:

<IMG SRC=/header.gif ALT="Turn on images to see the header">

Truly horrible. The lack of embedding is (IMO) the most glaring omission
from the original HTML specifications.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
  #4  
Old August 15th, 2007, 09:35 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Include another html file/content

Scripsit Steve Swift:
Quote:
Quote:
>Is this possible with html or css? Or in a compatible way?
>
Depending on the nature of your header, you could include it all in
one image, and use:
>
<IMG SRC=/header.gif ALT="Turn on images to see the header">
>
Truly horrible.
I agree; the markup is truly horrible. In a civilized country, with enforced
accessibility laws, the author should get sued and punished.

By the way, the "innocent" omission of quotation marks from the SRC
attribute value makes validators very "confused" and makes them throw quite
bizarre error messages at you (Google for "the saga of slashed validators"
if you need to know more).
Quote:
The lack of embedding is (IMO) the most glaring
omission from the original HTML specifications.
They thought that inclusion isn't really an HTML matter, and there's a point
in such thinking. But later "they" added frames, which allow inclusion, and
we all know where _that_ took "us" (well, just the misled authors).

Inclusion as a hypertext feature, even as a special case of a more general
concept like "transclusion", might be a good idea - if someone ever bothered
to _design_ and define it properly (and browsers implemented it). But to
return to our current universe, inclusion should almost always be handled
using tools outside HTML, such as authoring tools, preprocessors, or perhaps
as server-side includes (SSI and relatives).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

  #5  
Old August 15th, 2007, 10:35 AM
Steve Swift
Guest
 
Posts: n/a
Default Re: Include another html file/content

I agree; the markup is truly horrible. In a civilized country, with
Quote:
enforced accessibility laws, the author should get sued and punished.
Then I'm lucky that I live in a country that prefers to prosecute the
victims rather than the criminals! :-)

Putting quotes around url's that don't require(*) them serves no purpose
in my universe, and wastes disk space and bandwidth. Each pair of "'s
waste 0.4mS of my life when I'm connected via my 44Kbps modem (as
happened recently when my ADSL fails).

(*)Require: As in has never made the slightest discernible difference to
either myself or any of my users.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
  #6  
Old August 15th, 2007, 06:55 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Include another html file/content

Scripsit Steve Swift:
Quote:
Quote:
>I agree; the markup is truly horrible. In a civilized country, with
>enforced accessibility laws, the author should get sued and punished.
>
Then I'm lucky that I live in a country that prefers to prosecute the
victims rather than the criminals! :-)
You might be more correct than you think.
Quote:
Putting quotes around url's that don't require(*) them serves no
purpose in my universe, and wastes disk space and bandwidth.
So you waste everyone's time explaining that you save bandwidth by omitting
some required quotation marks.
Quote:
Each pair of "'s waste 0.4mS of my life
You're quite a life form, measured in millisieverts.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

  #7  
Old August 16th, 2007, 09:15 AM
Andreas Prilop
Guest
 
Posts: n/a
Default Re: Include another html file/content

On Wed, 15 Aug 2007, Jukka K. Korpela wrote:
Quote:
Quote:
>Each pair of "'s waste 0.4mS of my life
>
You're quite a life form, measured in millisieverts.
s second
S siemens
Sv sievert
scnr sorry, could not resist
  #8  
Old August 16th, 2007, 01:15 PM
David Stone
Guest
 
Posts: n/a
Default Re: Include another html file/content

In article
<Pine.GSO.4.63.0708161009220.3374@s5b004.rrzn.un i-hannover.de>,
Andreas Prilop <Prilop2007@trashmail.netwrote:
Quote:
On Wed, 15 Aug 2007, Jukka K. Korpela wrote:
>
Quote:
Quote:
Each pair of "'s waste 0.4mS of my life
You're quite a life form, measured in millisieverts.
>
s second
S siemens
Sv sievert
scnr sorry, could not resist
I'd have thought 0.4 mS would have provided sufficient resistance...
Maybe you just don't know how to conduct yourself? ;)
  #9  
Old August 23rd, 2007, 09:55 PM
Art
Guest
 
Posts: n/a
Default Re: Include another html file/content

On 8/14/07 10:26 AM, lg wrote:
Quote:
My site consists of many htm pages and each has a banner with my address and some
graphic.
>
Now each html page is something like this:
<html>
blah blah
<div>
my logo
my address
</div>
here comes to rest of the page
blah blah
</html>
>
So when I want to change my address or logo graphics I have to go through every
html page and make the changes.
>
What I would like is to a sperate page for the banner/logo:
banner.htm:
<div>
my logo
my address
</div>
>
and all the html page would have
<html>
blah blah
INCLUDE BANNER.HTM
here comes to rest of the page
blah blah
</html>
>
Is this possible with html or css? Or in a compatible way?
lg -
A simple way to accomplish this is by use of PHP (assuming your web
server supports PHP).

Simply place the following in your html page where you want the included
code for your banner/logo to appear:

<?php include("banner.htm"); ?>

and change the suffix of your html main page from .htm to .php.

You can specify multiple PHP includes as desired. For example, I use
this method for my top level navigation bar as well as a second one for
my common footer area.

It's sufficient to just specify the banner.htm file name if all of your
pages and the banner.htm file exist in the same directory. If they
don't, use an absolute URL description to the banner.htm file. Also use
an absolute URL if you've specified a <basetag in your html file as
this value isn't passed to the PHP pre-processor.

HTH...

Art
  #10  
Old August 24th, 2007, 10:45 AM
Andy Dingley
Guest
 
Posts: n/a
Default Re: Include another html file/content

On 23 Aug, 21:53, Art <m...@nowhere.comwrote:
Quote:
A simple way to accomplish this is by use of PHP (assuming your web
server supports PHP).
Why use PHP rather than SSI?

  #11  
Old August 24th, 2007, 03:25 PM
Art
Guest
 
Posts: n/a
Default Re: Include another html file/content

On 8/24/07 5:35 AM, Andy Dingley wrote:
Quote:
On 23 Aug, 21:53, Art <m...@nowhere.comwrote:
>
Quote:
>A simple way to accomplish this is by use of PHP (assuming your web
>server supports PHP).
>
Why use PHP rather than SSI?
>
Just another alternative for the OP depending on what services are
offered by the ISP/web server.

Art
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles