473,379 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Templates/inclusion in the new age

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
16 1979
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
"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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nomak | last post by:
Hello all, i have two template classes which needs each other. I tried to write some fwd decl / decl / impl in a good way but i can't get it to compile. Explanations: - .hh files are for...
3
by: Leslaw Bieniasz | last post by:
Cracow, 20.09.2004 Hi, I am posting this again, because my previous message dated 18.09. disappeared from the list (someone has cancelled it ? why ??). I have a problem with compiling the...
5
by: Dave | last post by:
Hello all, To protect against multiple inclusions, it is standard practice to enclose the contents of a header file in a construct like this: #ifndef FOO_INCLUDED #define FOO_INCLUDED .......
1
by: Rebecca Hoffmann | last post by:
Hi, I have a serious problem while compiling a small project (a part of the Modular Flow Scheduling Middleware: ex1): There are 3 linker errors, all from symbols that point to templates: --...
4
by: Igor.Smirnov | last post by:
Does somebody remember, when templates appeared really in C++ compilers and became fully operational, and also when they appeared in C++ standard? Thanks! --
7
by: Bern McCarty | last post by:
We have some large mixed .dlls. The percentage of code that is managed is small relative to the percentage of native code. We generally want to favor native callers. But I am struggling with the...
12
by: Ben | last post by:
I'm kind of new to creating templates. I've made some small class and function templates in the past and I have used quite of bit of the STL, but I am having problems tyring to create templates. ...
2
by: asdf | last post by:
There are two strategies for compiling templates: the includsion model and the seperate compilation model. Could you please tell me which models vc++ and gcc take, respectively? Thanks.
6
by: Hunk | last post by:
Hi I have a question on usage of forward declarations of templates. While searching through this group , people suggested using forward declarations and typedefs for templates as // in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.