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

Templates/inclusion in the new age

P: n/a
I used to work as a web designer a couple of years ago, but I haven't
been closely in touch in the past years. Has anything changed recently
for managing content that is common among many pages (menus, headers,
footers...)?

The main options I recall are:
- Frames :P
- Server-side includes
- Dreamweaver templates
- PHP includes

I used Dreamweaver templates a lot -- learned to love them -- but now
I'm working on a project with another guy who does not have Dreamweaver.
I don't want to force it on him.

Is there a standard in XHTML or newer HTML standards that allows file
inclusion (much like CSS inclusion)? Or, is there some type of
pre-processor that I can run on my files to generate the final pages
(like Dreamweaver does it internally)? Ideally I would like the content
to be viewable off-line (e.g. no server-side includes)...

Thanks in advance fellow web monkeys!

Nathan
Jul 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Nathan Funk wrote:
I used to work as a web designer a couple of years ago, but I haven't
been closely in touch in the past years. Has anything changed recently
for managing content that is common among many pages (menus, headers,
footers...)?
No, the options are the same as you remember.
Is there a standard in XHTML or newer HTML standards that allows file
inclusion (much like CSS inclusion)?
xhtml offers nothing that html does not offer by way of markup.
Ideally I would like the content
to be viewable off-line (e.g. no server-side includes)...


The best way to do that is to run a web server on your production box.

--
Brian (remove ".invalid" to email me)

Jul 20 '05 #2

P: n/a
"Nathan Funk" <no**@none.com> a écrit dans le message de
news:HNuuc.626609$oR5.331266@pd7tw3no
Has anything changed recently
for managing content that is common among many pages (menus, headers,
footers...)?

The main options I recall are:
- Frames :P
- Server-side includes
- Dreamweaver templates
- PHP includes


You can add iFrame (and for XHTML? object but I don't think it is as
supported as iFrame)

Jul 20 '05 #3

P: n/a
Nathan Funk wrote:
Is there a standard in XHTML or newer HTML standards that allows file
inclusion (much like CSS inclusion)?


Not specifically for XHTML, but there is XInclude [1]. This is
specifically for including XML fragments within another XML document.
Although it's still a candidate recomendation, so don't expect it to be
*widely* implemented in the common browsers for a while, if at all.
This may be more useful with some kind of XML preprocessor that parses
you're pages and includes the necessary files automatically before
sending to the client.

[1] http://www.w3.org/TR/xinclude/

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #4

P: n/a
Brian wrote:
Nathan Funk wrote:
I used to work as a web designer a couple of years ago, but I haven't
been closely in touch in the past years. Has anything changed recently
for managing content that is common among many pages (menus, headers,
footers...)?


No, the options are the same as you remember.


Thanks for the reply, but that's just sad. It's probably one of the main
features that would finally allow clean programming...

What would be wrong with an <include src="mymenu.xhtml"/> ? Something so
similar is already done for including CSS and scripts... why not also
plain content???

Maybe there's a good explanation for this. If so, you would make me a
happier person by letting me know :)

Thanks for all your responses so far,

Nathan
Jul 20 '05 #5

P: n/a
In article <n7Xvc.667199$Ig.175337@pd7tw2no>, no**@none.com enlightened
us with...

What would be wrong with an <include src="mymenu.xhtml"/> ? Something so
similar is already done for including CSS and scripts... why not also
plain content???


There is. I dunno how cross-browser it is, but it works in IE6 and NN6.

<object id="file1" data="test.html" type="text/html" width="100%"
height="50%" standby="Loading test.html...">
Your browser cannot render embedded HTML documents.
</object>
--
--
~kaeli~
A man needs a mistress... just to break the monogamy.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #6

P: n/a
kaeli <ti******@NOSPAM.comcast.net> wrote:
What would be wrong with an <include src="mymenu.xhtml"/> ? Something so
similar is already done for including CSS and scripts... why not also
plain content???


There is. I dunno how cross-browser it is, but it works in IE6 and NN6.

<object id="file1" data="test.html" type="text/html" width="100%"


That's embedding not including.

Embedding opens up a new viewport inside the existing viewport.

--
Spartanicus
Jul 20 '05 #7

P: n/a
On Fri, 04 Jun 2004 15:21:02 +0100, Spartanicus <me@privacy.net> wrote:
kaeli <ti******@NOSPAM.comcast.net> wrote:
What would be wrong with an <include src="mymenu.xhtml"/> ?
There is. I dunno how cross-browser it is, but it works in IE6 and NN6.
<object id="file1" data="test.html" type="text/html" width="100%"


That's embedding not including.
Embedding opens up a new viewport inside the existing viewport.


As per SGML tradition, 'includes' are handled through the entity
expansion mecanism.

It is something that has been there for ages but since in SGML the word
'entity' was not spelled out as 'include' we do have the lack of
understanding of the difference betwen the described noun 'entity' and
the sometimes implemented verb 'include'

I hope that Nick has kept a usable interface for this illustration of
mine.

http://css.nu/markup/markup-entities.html

All the best...

Jul 20 '05 #8

P: n/a
Nathan Funk <no**@none.com> wrote:
I used to work as a web designer a couple of years ago, but I haven't
been closely in touch in the past years. Has anything changed recently
for managing content that is common among many pages (menus, headers,
footers...)?


No, the options are the same as you remember.


Thanks for the reply, but that's just sad. It's probably one of the main
features that would finally allow clean programming...

What would be wrong with an <include src="mymenu.xhtml"/> ? Something so
similar is already done for including CSS and scripts... why not also
plain content???


Let's assume that HTML 4 would have added a client side include method,
all existing UAs (Google etc.) would then have been broken,
unacceptable.

Now let's assume that HTML 4 would have added <poem></poem> markup,
compliant pre HTML 4 UAs would ignore this unknown markup as per spec
and render the content. This is acceptable behaviour for a markup
language which is meant to be backward compatible.

Afaics it's possible to add Client Side Includes to something like XHTML
2, since it's designed to be not backward compatible.

It might be nice to have that coupled to css media rules, so that you
can include code depending on the output media.

--
Spartanicus
Jul 20 '05 #9

P: n/a
In article <hm********************************@4ax.com>,
Jan Roland Eriksson <jr****@newsguy.com> writes:
I hope that Nick has kept a usable interface for this illustration of
mine.
/me looks up ...
http://css.nu/markup/markup-entities.html


Ah, yes. I think you can take that as stable for the forseeable
future (ie unless something very bad happens, like a new security
problem concerning OpenSP that I can neither live with nor fix).

Did you notice http://valet.webthing.com/catalogue/ ?
Not an online demo, but a very practical application of the concept.
Well, in a manner of speaking: SGML is perhaps not an entirely
conventional choice of tool for the job:-)

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 20 '05 #10

P: n/a
Nathan Funk <no**@none.com> wrote:
What would be wrong with an <include src="mymenu.xhtml"/> ? Something so
similar is already done for including CSS and scripts... why not also
plain content???
Indeed, why can't you use the script element type to include HTML or
plain text?

<script src="why.html" type="text/html"> </script>
<script src="why.txt" type="text/plain"> </script>

Any browser (all of them) that can render files served as text/plain
or text/html should have no trouble with this.

But in fact they will all ignore it, because they "think" they don't
have a "plain text script interpreter" (Actually they do, Opera's
plain text interpreter, for example, inserts <PRE></PRE> around a text
file before passing it on to its HTML parser to be rendered.) or "HTML
script interpreter".

Maybe there's a good explanation for this. If so, you would make me a
happier person by letting me know :)


Web browsers are simple-minded pieces of software created by
simple-minded vendors.

--
"He's got a personality. He must have one, I'm sure. He just hides it
well."
- Natalie Barr describing Peter Costello.
Jul 20 '05 #11

P: n/a
Wolfgang Wildeblood wrote:
Indeed, why can't you use the script element type to include HTML or
plain text?

<script src="why.html" type="text/html"> </script>
<script src="why.txt" type="text/plain"> </script>


Because that would be semantically incorrect. The <script/> element
is specifically for including scripts into an (X)HTML document; nothing
else. As several people have already mentioned that using <object> can
import or maybe <iframe> can include other XHTML documents, so it's not
only incorrect, but there is no need to use <script> to include other
documents. The only problem with <object> is that it's not supported by
some older browsers, and barely supported correctly in IE. However,
IIRC, IE does work with: <object type="text/html"
data="file.html"></object>, but not much else.

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #12

P: n/a
Lachlan Hunt wrote:
Wolfgang Wildeblood wrote:
Indeed, why can't you use the script element type to include HTML or
plain text?

<script src="why.html" type="text/html"> </script>
<script src="why.txt" type="text/plain"> </script>
Because that would be semantically incorrect. The <script/> element
is specifically for including scripts into an (X)HTML document; nothing
else.


Define "script"? Are you saying that if it doesn't require the browser
to use its JavaScript interpreter then it can't be a script? That's
certainly how it is in practice, but it has nothing to do with
"semantics".

As several people have already mentioned that using <object> can
import or maybe <iframe> can include other XHTML documents, so it's not
only incorrect, but there is no need to use <script> to include other
documents.
And as was already stated earlier in this thread, those people don't
know the difference between "included" and "embedded". Read the posts
by "Spartanicus" and Roland.

The only problem with <object> is that it's not supported by
some older browsers, and barely supported correctly in IE.
The problem with OBJECT is that it has nothing to do with inclusion,
and is completely irrelevant to the present discussion. Entities would
be the correct way to go, as Roland said, but they suffer the
"disadvantage" of not involving pointy brackets.

However, IIRC, IE does work with: <object type="text/html"
data="file.html"></object>, but not much else.


MSIE works with all manner of embedded objects, it just doesn't work
the same as other browsers. I won't be lured into defending MSIE here,
but neither will I ignore the opportunity to point out that the weird
syntax required by MSIE, while different to what the sane world
prefers, is valid HTML by the W3C recommendations. Those benevolent
idealists leading the web to its full potential just couldn't say no
to Microsoft.

--
"Everybody can run Qantas better than I can."
- Geoff Dixon, Qantas CEO.
Jul 20 '05 #13

P: n/a
Wolfgang Wildeblood wrote:
Define "script"?
See this Google search for define:Script [1], the HTML 4.01
specification [2], or consult a dictionary or any other reference
material of your choice.
Are you saying that if it doesn't require the browser to use
its JavaScript interpreter then it can't be a script? That's
certainly how it is in practice, but it has nothing to do with
"semantics".
It doesn't have to be JavaScript, but it does have to be a script; it
could be any kind of scripting language, however JavaScript is the only
common language implemented by the popular browsers (or at least a
fairly compatible version, as is the case for IE's JScript). AFAIK, IE
is the only popular browser that supports another scripting language,
VBScript, but there could be others that I don't know about.
The problem with OBJECT is that it has nothing to do with inclusion,


Yes it does! The HTML 4.01 specification clearly calls it Generic
Inclusion [3].
[1] Searched for "define:Script"
http://www.google.com.au/search?hl=e...=define:Script
[2] http://www.w3.org/TR/html401/interac...ml#edef-SCRIPT
[3] http://www.w3.org/TR/html401/struct/...ml#edef-OBJECT
--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #14

P: n/a
Lachlan Hunt <la**********@lachy.id.au.update.virus.scanners> wrote:
The problem with OBJECT is that it has nothing to do with inclusion,


Yes it does! The HTML 4.01 specification clearly calls it Generic
Inclusion [3].


Should be ignored, <object> embeds, using the phrase inclusion for that
process causes babylonian confusion.

--
Spartanicus
Jul 20 '05 #15

P: n/a
Lachlan Hunt wrote:
Wolfgang Wildeblood wrote:
Define "script"?


See this Google search for define:Script [1], the HTML 4.01
specification [2], or consult a dictionary or any other reference
material of your choice.


Oh please, stop. I'm completely at the mercy of your rapier-like wit.
Jul 20 '05 #16

P: n/a
Nathan Funk wrote:
Brian wrote:
Nathan Funk wrote:
Has anything changed recently for managing content that is
common among many pages (menus, headers, footers...)?
No, the options are the same as you remember.


that's just sad. It's probably one of the main features that would
finally allow clean programming...


HTML is not a programming a language.
What would be wrong with an <include src="mymenu.xhtml"/> ?
Something so similar is already done for including CSS and
scripts... why not also plain content???


HTML was not designed that way. It is a fairly simple markup language,
nothing more.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.