473,698 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Include another html file/content

lg
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?
Aug 14 '07 #1
10 7783
lg wrote:
>
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
Aug 14 '07 #2
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
Aug 15 '07 #3
Scripsit Steve Swift:
>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).
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 "transclusi on", 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/

Aug 15 '07 #4
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! :-)

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
Aug 15 '07 #5
Scripsit Steve Swift:
>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.
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.
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/

Aug 15 '07 #6
On Wed, 15 Aug 2007, Jukka K. Korpela wrote:
>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
Aug 16 '07 #7
In article
<Pi************ *************** ***@s5b004.rrzn .uni-hannover.de>,
Andreas Prilop <Pr********@tra shmail.netwrote :
On Wed, 15 Aug 2007, Jukka K. Korpela wrote:
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? ;)
Aug 16 '07 #8
Art
On 8/14/07 10:26 AM, lg wrote:
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
Aug 23 '07 #9
On 23 Aug, 21:53, Art <m...@nowhere.c omwrote:
A simple way to accomplish this is by use of PHP (assuming your web
server supports PHP).
Why use PHP rather than SSI?

Aug 24 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1647
by: chopper | last post by:
Please excuse the long post but I can't think of shorter way of explaining the issue. Please could someone advise on the following: I'm writing preview functionality for a CMS written in ASP. Currently, when a page is published (physical file created in the website) it contains include directives to pull in commonly used bits of HTML and ASP such as the header and footer of pages. In the preview functionality I want to be able to have...
22
2897
by: Long | last post by:
Problem: to insert the content of a file in an HTML document at a specific location. One possible way is to add a WebCharm tag like this: <%@charm:text 20 0 my_include_file.txt %> When the HTML template is processed by a WebCharm-aware web server, the content of my_include_file.txt is inserted at the tag location. This work very much like the SSI #include tag. However, you have more control
1
1630
by: RWC | last post by:
Hey Folks! I'm having trouble with an asp page. First off, I'm new to the html / asp world, but not to software development. I'd like to minimize or "normalize" the site, so I'm trying to use one menu page and include it into any page that needs the menu. The problem is, I include the header.asp page, include the menu.asp page, but when I write the body of the page, it sticks the text underneath the side menu. I'd like the text to...
9
434
by: Howard | last post by:
Hello I need some help with this. I want to assign the content of a static txt/html file to my string a. <script runat="server" language="C#"> private void Page_Load(object sender, System.EventArgs e) { string a = //include static html page welcome.htm
7
1543
by: Andre | last post by:
I want to condition what include files are included in an web page (.aspx). Something like: if (condition1) { <!-- #Include File='file1.htm' --> } else if (condition2) { <!-- #Include File='file2.htm' -->
6
2119
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file = ...\includes\StaffingHeaders.inc -->" </Script> <%=ClientName%> ****************************************************************************
1
1931
by: Kevin | last post by:
How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how? Basically if the file exists, it should display the page that will include mb.html. ---------------------------------------------------------------------------------------------------------
1
4624
by: ningjun.wang | last post by:
I need to include to static html files in my asp.net page. The order of include depend on query string. Here is the pseudo code mypage.aspx: <% string mode = Request; if (mode == "A") { include("file1.html"); // How to do this? include("filee2.html");
14
3146
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the PHP interpreter works like any other, that is, it first expands all the include files, and then parses the resulting text. Can anyone help with an explanation? Thanks, M. McDonnell
1
2237
by: yemen2007 | last post by:
hi ever one. i have problem in my html file. i have header file , footer file, and index file. i want compile the header , and footer in the index file use include file put it is not work. this my code.so plz hellp me this inside the footer.html <a href="contact_info.html">Contact Us</a> <a href="copyright_info.html">Copyright &copy; 2000-2002</a> <a href="about_us.html">Tailspin Toys</a> this inside the header.html
0
8671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8856
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.