469,315 Members | 2,012 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

Help putting standard headers on all pages

I've been looking for references for some weeks now, but haven't found
an answer to the following question. I'd love some help on this:

*Without* using JavaScript or other active client-side scripting,
server-side includes or frames, is there a way to include a standard
header on all pages within a site? The design goal is to have the
header links and title graphic on every page kept in some single
place, so that a change to the header data doesn't require changing
every single html file on the site. (The sites in question are my
personal sites - see signature).

In other words, I want a way to do this in regular (non-framed) non-
active HTML and CSS only. It seems like there ought to be a way to do
it with CSS, but I really can't work it out.

Thanks for any pointers...

--
Lewin A.R.W. Edwards
Projects - http://www.zws.com/
Personal - http://www.larwe.com/

Sep 21 '08
68 4261
In article <6e*********************@giganews.com>,
Guy Macon <http://www.GuyMacon.com/wrote:
dorayme wrote:
(all bets are off with a commercial Windows server though.
I operate on a couple of these and I also use php and
includes but it is more complicated and gives me more
of a headache)

Are you sure you mean "Windows server" (Operating System is
Microsoft Windows, Web server could be Apache, IIS, or other)
or did you actually mean to specify a Microsoft IIS Server?
Yes, I meant the very latter. Thanks for clearing this up. (But on my
own PC (as well as my Mac) I have Apache servers.

I am at the bottom of the earth,

Not so. The Arctic Ocean is at the bottom of the earth.
On my wall I have a map made in Australia that clearly
shows this. :)
This is actually a serious matter, you try hanging on to a globe when
you are even *roughly* towards the bottom of it. Why do you think rf,
Chaddy and I are a bit volatile. We face danger at all times, that's why.

--
dorayme
Sep 22 '08 #51
On Sep 21, 7:06*pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
What you are not making perfectly clear, given what has been said to
you, is what *good reason* you have not to use includes. The reasons you

"Doctor, my head hurts when I bang it against the wall"
If you want to use this analogy - which is fine - consider me as
someone with strong religious beliefs who doesn't want any part of
COTS medicine. I want the toadstools and grasshopper saliva cure, not
aspirin. Thus far it seems the IFRAME meets this description.
Sep 22 '08 #52
On Sep 21, 11:07*pm, dorayme <doraymeRidT...@optusnet.com.auwrote:

Though I do have an Apache server running on a Linux box

on *a* Linux box? We talking a different machine now?
Yes. I do essentially all of my work on three machines:

- MacBook running OSX 10.4 for all my email, office productivity, web
development. It has VirtualBox running both Windows and Linux for
various embedded development toolchains. I spend 90% of my time on
this machine.

- a tablet PC running XP Tablet used for taking notes and occasionally
for running JTAG tools that positively cannot work inside VirtualBox
on the Mac.

- an x86 desktop PC running Ubuntu, with a large (3TB) RAID array.
This is a backend server for those devices I mentioned earlier, and it
also holds my SVN repository.

Give me an example url of a simple set of two or three pages with a menu
(for example) that is repeated on the three pages. I will put it an
FWIW my IFRAME test - NOT fully debugged - is at http://www.larwe.com/test/
but it doesn't yet meet your criteria.
Are you on earth?
Yes, however I'm on Earthlink cable (resold TWC) in NYC.

You are in NYC and on cable and you experience slow? I am on ADSL, I am
at the bottom of the earth, and frankly, the speed makes me dizzy.
Yep. I actually migrated from Melbourne to New York the best part of
ten years ago, back in the days when pay TV was a new thing not
available in all neighborhoods.
Sep 22 '08 #53
On Sep 21, 10:19*pm, Guy Macon <http://www.GuyMacon.com/wrote:
The Game of Why Don't You / Yes But
I'm well aware of it, having been on both sides of the net (?
goalposts? ring? home plate?).

I asked for a solution that's as low-tech as possible because hi tech
breaks. I don't /like/ most of the solutions that have been posited so
far, but I'm trying out two of them to determine how disruptive
they'll be. As for my pet answer, well, I don't like it very much
either. All conceivable solutions will break under certain
circumstances; I've got to make a judgement as to which will be least
disruptive to me.
Sep 22 '08 #54
zw*******@gmail.com wrote:
On Sep 21, 10:19 pm, Guy Macon <http://www.GuyMacon.com/wrote:
>The Game of Why Don't You / Yes But

I'm well aware of it, having been on both sides of the net (?
goalposts? ring? home plate?).

I asked for a solution that's as low-tech as possible because hi tech
breaks. I don't /like/ most of the solutions that have been posited so
far, but I'm trying out two of them to determine how disruptive
they'll be. As for my pet answer, well, I don't like it very much
either. All conceivable solutions will break under certain
circumstances; I've got to make a judgement as to which will be least
disruptive to me.
The real, most efficient, and effective solution is includes, be they
SSI, PHP, ASP.net, CF whatever... Break pages in to logical common
components and assemble server-side. Anything less will be limited,
cumbersome, inefficient or a combination of all three. Since you already
have a local development *nix server then I would say PHP includes would
be your best bet. The local server will show you your composite content
during development and maintenance and then you will only have to edit
and upload content that changes *once*.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Sep 22 '08 #55
In article
<2f**********************************@2g2000hsn.go oglegroups.com>,
zw*******@gmail.com wrote:
On Sep 21, 10:19*pm, Guy Macon <http://www.GuyMacon.com/wrote:
The Game of Why Don't You / Yes But

I'm well aware of it, having been on both sides of the net (?
goalposts? ring? home plate?).

I asked for a solution that's as low-tech as possible because hi tech
breaks. I don't /like/ most of the solutions that have been posited so
far, but I'm trying out two of them to determine how disruptive
they'll be. As for my pet answer, well, I don't like it very much
either. All conceivable solutions will break under certain
circumstances; I've got to make a judgement as to which will be least
disruptive to me.
See the note at the foot of:
http://www.w3.org/TR/html401/present...ml#edef-IFRAME

which links to
http://www.w3.org/TR/html401/struct/...dded-documents

I don't know if this does what you want, or how well different
browsers will handle it, but it does appear to be an alternative
to iframe, scripting, or server-side includes.

(I'd be interested to know if anyone has actually tried this
for, for example, a navigation menu. I will try it when I have
time, but that won't be for a while :( )
Sep 22 '08 #56
Guy Macon wrote:
>
Blinky the Shark wrote:
>>That said, do you have a problem with your faithful editor (me! <g>)
changing the name to, simply, "Yes-But"? It's catchier, and the "Why
Don't You" is explained in the text.

No problem at all.
Thanks. I'll link to it now from my Usenet index page.

The "self-taught" part of your rez was quite a surprise.
--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Need a new news feed? http://blinkynet.net/comp/newfeed.html

Sep 22 '08 #57
On Sep 22, 12:10*pm, David Stone <no.em...@domain.invalidwrote:
See the note at the foot of:http://www.w3.org/TR/html401/present...ml#edef-IFRAME
I think from a cursory read this is my IFRAME solution, which works
though others here have deprecated it.

There are no real subpages here, but my test implementation is at
http://www.larwe.com/test/ - it works, but breaks when the browser
width is too narrow. Also, my particular demo page has a transparent
PNG, which Internet Explorer won't handle - it looks OK in Firefox/
Safari/etc but I guess I have to fix that issue.
Sep 22 '08 #58
On 22 Sep, 04:36, zwsdot...@gmail.com wrote:
On Sep 21, 7:14*pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
reason I don't like them - I can't preview them without slowly
uploading them to my server.
You can preview them by running a home server. Get a Mac and do yourself
a favour, comes with a server, you just tick a box and its on.

This message is brought to you by my 2.16GHz Core 2 Duo MacBook.

Though I do have an Apache server running on a Linux box (it runs my
svn server and acts as the home-base backend for some experimental
embedded devices I have out in the field). If I develop something on
that server, though, will it be just "drag and drop"
Mac, linux what is the difference? "Drag and drop", "Plug and Pray"
what else du you want? Are you on crack too?
when I move it to
the environment on my hosting provider? I don't get that impression;
all the FAQs I read talk about all kinds of hardcoded paths and
environment-specific stuff.

This is what I mean when I say I don't like doing stuff that relies on
proprietary infrastructure.
What are you talking about. Proprietary infrastructure?

Your pages have to be served by an web server. On every webserver you
can use SSI. An simple SSI can look like this:

<!--#include virtual="header.html"-->

This file called 'header.html' just have to lay on your folder under
the document root. That don't depended on an proprietary
infrastructur. That's the same if the document root is on an Mac,
Linux or Window server, and if you're using IIS, Apache or whatever.
Are you on earth?

Yes, however I'm on Earthlink cable (resold TWC) in NYC.
I don't know if that is an excuse.
Sep 22 '08 #59
zw*******@gmail.com writes:
On Sep 22, 12:10*pm, David Stone <no.em...@domain.invalidwrote:
>See the note at the foot of:http://www.w3.org/TR/html401/present...ml#edef-IFRAME

I think from a cursory read this is my IFRAME solution, which works
though others here have deprecated it.
You did not "see the note at the foot" (David Stone gave the direct
link as well).

--
Ben.
Sep 23 '08 #60
On 22 Sep, 18:10, David Stone <no.em...@domain.invalidwrote:
In article
<2f718cb7-242d-43d2-a7ef-b2bbe7b7a...@2g2000hsn.googlegroups.com>,

zwsdot...@gmail.com wrote:
On Sep 21, 10:19 pm, Guy Macon <http://www.GuyMacon.com/wrote:
The Game of Why Don't You / Yes But
I'm well aware of it, having been on both sides of the net (?
goalposts? ring? home plate?).
I asked for a solution that's as low-tech as possible because hi tech
breaks.
Not as bad as iframes. But then, all "hi tech" seems to break at your
end.
I don't /like/ most of the solutions that have been posited so
far, but I'm trying out two of them to determine how disruptive
they'll be. As for my pet answer, well, I don't like it very much
either. All conceivable solutions will break under certain
circumstances; I've got to make a judgement as to which will be least
disruptive to me.
I wonder what your conclusion would be.
See the note at the foot of:http://www.w3.org/TR/html401/present...ml#edef-IFRAME

which links tohttp://www.w3.org/TR/html401/struct/objects.html#embedded-documents

I don't know if this does what you want, or how well different
browsers will handle it, but it does appear to be an alternative
to iframe, scripting, or server-side includes.
They renders more or less the same.
(I'd be interested to know if anyone has actually tried this
for, for example, a navigation menu. I will try it when I have
time, but that won't be for a while :( )
If you have an formula like those on Stan Browns page,
http://www.tc3.edu/instruct/sbrown/ti83/skurt.htm

, you could use xhtml and present it with MathML:

<object data="math.xhtml" type="application/xhtml+xml" style="height:
5em; width: 100%; overflow: auto"
<img src="math.gif" alt="..." longdesc="description.html">
</object>

You could do the same with figures in SVG.

No browsers seems to support intrinsic dimensions (anymore) for
embedded html/xhtml documents.

You can take a look some testcases at:
http://joliclic.free.fr/html/object-tag/en/
Sep 23 '08 #61
In article
<d1**********************************@c58g2000hsc. googlegroups.com>,
"Roy A." <ro*********@gmail.comwrote:
On 22 Sep, 18:10, David Stone <no.em...@domain.invalidwrote:
[snip]
See the note at the foot
of:http://www.w3.org/TR/html401/present...ml#edef-IFRAME

which links
tohttp://www.w3.org/TR/html401/struct/objects.html#embedded-documents

I don't know if this does what you want, or how well different
browsers will handle it, but it does appear to be an alternative
to iframe, scripting, or server-side includes.

They renders more or less the same.
[snip]
You can take a look some testcases at:
http://joliclic.free.fr/html/object-tag/en/
Interesting. May I suggest that you add the links for the specific
test cases into each section? That way, readers don't have to scroll
all the way to the bottom of the page if they are only interested in
embedding, say, a flash object.

One potential problem appears to be that the NoScript plugin (which
I leave on by default) didn't load the "resultObject" until I
allowed this. Presumably, this indicates that others have abused this
technique in the past, much like frames and iframes. I wonder if
other "security" software or settings would cause similar problems?
Sep 23 '08 #62
On 23 Sep, 14:10, David Stone <no.em...@domain.invalidwrote:
In article
<d13baf9b-d9f3-4a6c-a5ca-bbb341a19...@c58g2000hsc.googlegroups.com>,
"Roy A." <royarnes...@gmail.comwrote:

On 22 Sep, 18:10, David Stone <no.em...@domain.invalidwrote:
[snip]
See the note at the foot
of:http://www.w3.org/TR/html401/present...ml#edef-IFRAME
which links
tohttp://www.w3.org/TR/html401/struct/objects.html#embedded-documents
I don't know if this does what you want, or how well different
browsers will handle it, but it does appear to be an alternative
to iframe, scripting, or server-side includes.
They renders more or less the same.
[snip]
You can take a look some testcases at:
http://joliclic.free.fr/html/object-tag/en/

Interesting. May I suggest that you add the links for the specific
test cases into each section?
Sorry, what I wrote about embedded html/xhtml documents wasn't related
to those testcases.

The main rendering problem is that browsers don't support intrinsic
dimensions for embedded document like:

<object data="math.xhtml" type="application/xhtml+xml"
style="height: auto; width: auto"
<img src="math.gif" alt="..." longdesc="description.html">
</object>

Browsers that don't support "application/xhtml+xml" are using the
alternate content.
That way, readers don't have to scroll
all the way to the bottom of the page if they are only interested in
embedding, say, a flash object.
Hm, those testcases isn't mine. With flash objects, I don't think
problems with intrinsic dimensions applies in the same degree. I
haven't used flash, but it seems that they always comes with
dimensions fixed in pixels.
One potential problem appears to be that the NoScript plugin (which
I leave on by default) didn't load the "resultObject" until I
allowed this.
Isn't that a good thing? Then you can run flash only from domains you
trust.
Presumably, this indicates that others have abused this
technique in the past, much like frames and iframes.
No, what do flash got do with frames and iframes? It might indicate
that others has abused flash. AFAIK the object element don't allow
scripting between the parent document and the "entirely independent"
embedded document in the object element.
<http://www.w3.org/TR/html401/struct/objects.html#embedded-documents>
I wonder if
other "security" software or settings would cause similar problems?
It might.
Sep 24 '08 #63
In article
<78**********************************@j22g2000hsf. googlegroups.com>,
"Roy A." <ro*********@gmail.comwrote:
On 23 Sep, 14:10, David Stone <no.em...@domain.invalidwrote:
[snip]
You can take a look some testcases at:
>http://joliclic.free.fr/html/object-tag/en/
[snip]
>
One potential problem appears to be that the NoScript plugin (which
I leave on by default) didn't load the "resultObject" until I
allowed this.

Isn't that a good thing? Then you can run flash only from domains you
trust.
Presumably, this indicates that others have abused this
technique in the past, much like frames and iframes.

No, what do flash got do with frames and iframes? It might indicate
that others has abused flash. AFAIK the object element don't allow
scripting between the parent document and the "entirely independent"
embedded document in the object element.
<http://www.w3.org/TR/html401/struct/objects.html#embedded-documents>
If you view the source of the test case pages linked from the
joliclic.free.fr page referenced above, you'll see that the very
first object is text/html, which is blocked even though it is NOT
a flash object. Here's an explicit link showing the problem:

http://joliclic.free.fr/html/object-...text.html#html

I suspect a prior security problem stemming from html pages embedded
using the object tag prompted the NoScript authors to block such
things by default; if other security packages/plugins do the same thing,
this would undermine using the object tag as an alternative to scripting
and SSIs as a way of handling common content.
Sep 24 '08 #64
On 24 Sep, 14:13, David Stone <no.em...@domain.invalidwrote:
In article
<78f15c48-1400-4bab-a0ee-814456030...@j22g2000hsf.googlegroups.com>,
"Roy A." <royarnes...@gmail.comwrote:

On 23 Sep, 14:10, David Stone <no.em...@domain.invalidwrote:
[snip]
You can take a look some testcases at:
http://joliclic.free.fr/html/object-tag/en/
[snip]
[...]
>
No, what do flash got do with frames and iframes? It might indicate
that others has abused flash. AFAIK the object element don't allow
scripting between the parent document and the "entirely independent"
embedded document in the object element.
<http://www.w3.org/TR/html401/struct/objects.html#embedded-documents>

If you view the source of the test case pages linked from the
joliclic.free.fr page referenced above, you'll see that the very
first object is text/html, which is blocked even though it is NOT
a flash object. Here's an explicit link showing the problem:

http://joliclic.free.fr/html/object-...text.html#html
I suspect a prior security problem stemming from html pages embedded
using the object tag prompted the NoScript authors to block such
things by default;
Who knows what an unsigned add-on might do. It's ridicules. An static
html page served as 'text/html' or 'application/xhtml+xml' page isn't
a security problem. At least you should be able to see the alternate
content.
if other security packages/plugins do the same thing,
Why would they do that. An static html page from the same domain isn't
a security problem. They might let you disable iframes, or third party
objects, but that's another question. Again, you should be able to see
the alternate content.
this would undermine using the object tag
Well, some vendors would like to do that.
as an alternative to scripting
And scripting is more secure than an static html page? And the
'NoScript' add-on is just plain fun?
and SSIs as a way of handling common content.
Well, server side scripting is a way to handle alternate content like
html vs xhtml. Just serve e.g. MathML or SVG to browsers that handles
'application/xhtml+xml' and a bitmap picture with alt text to other
browsers. With simple CSS like 'display: block' and 'display: hidden',
you can serve unreadable xhtml to an html parser, without reducing the
experience for people with disabilities.
Sep 24 '08 #65
Ben Bacarisse wrote:
The usual method it to include some sort of build step when making the
site. There are literally dozens of options from WYSIWYG site editing
software to using a macro processor and something like make.
Yes, I use m4 and make for this sort of thing.

robert
Sep 27 '08 #66
On Sep 20, 8:53*pm, zwsdot...@gmail.com wrote:
*Without* using JavaScript or other active client-side scripting,
server-side includes or frames, is there a way to include a standard
header on all pages within a site? The design goal is to have the
For what it's worth, I've concluded that the answer to this question
is "yes, but all the methods have significant downsides." I am using
SSI. TheFAQ from my provider was stale information.
Sep 29 '08 #67
On Sun, 21 Sep 2008 13:50:11 -0400, Stan Brown
<th************@fastmail.fmwrote:
>Sun, 21 Sep 2008 14:27:28 +0300 from Jukka K. Korpela
<jk******@cs.tut.fi>:
>No amount of reduction in site management work (like moving from manually
maintained headers to iframed header file) could ever justify all the
problems you create by using IFRAME.

My situation is not common headers, which indeed I handle by
preprocessing, but common *page content* in two different sites with
different structures.

Here's a sample URL:
http://oakroadsystems.com/math/tiskurt.htm

The actual content (inside the IFRAME) is at my college's Web site:
http://www.tc3.edu/instruct/sbrown/ti83/skurt.htm

There may be a better way to accomplish what I'm trying to do, which
is to make the content available through my Web site and through the
College Web site, without duplicate uploading all the content. (There
are several dozen instructional pages like this, and the average page
is updates maybe two or three times a year.) Suggestions?

Notce that just above the IFRAME I do give a link for busting out of
the frame.
Personally, I think it's a good application for an IFRAME.

I suppose IFRAME's can overused/abused like everything else. The only
problem I've come across with IFRAMES is that search engines don't
seem to follow any links contained within the frame.

Rob
Oct 12 '08 #68

RobC wrote:
>I suppose IFRAME's can overused/abused like everything else. The only
problem I've come across with IFRAMES is that search engines don't
seem to follow any links contained within the frame.
Try creating shortcuts with different frames selected.

--
Guy Macon
<http://www.GuyMacon.com/>

Oct 12 '08 #69

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.