[thelist] quick ssi question

Scott Schrantz scotts at rci-nv.com
Wed Dec 12 10:32:52 CST 2001


> -----Original Message-----
> From: Adam [mailto:adam at hallinteractive.com]
>
> I'm curious about something.
> When using an include in an html document typically wouldn't 
> you keep all of
> the document structure out of the include? like so:
> 
> <myinclude.inc>
> <p>stuff and things, stuff and things</p>
> </myinclude.inc>
> 
> and then the parent html doc would control the presentation 
> and formatting?
> Is this correct?

You kind of have it backwards. An include should have everything that you
want to be the same on each page. So, things like the presentation and
formatting should be _in_ the include, and the content would be in the
parent html doc. Like:

<body>
<-- #include file="header.inc" -->

<-- #include file="menu.inc" -->

<p>Page Content</p>

<-- #include file="footer.inc" -->
</body>

That way you need to modify only a few files, and you change the
presentation and formatting of the entire site.

> and if so,
> 
> what if I want to include and entire html doc that has 
> embedded js in it,
> like a nav system?
> would the include on its own be contained within html like this?:
> <snip />

You wouldn't want all the <head> and <html> tags in an include, unless you
were using frames. The way I would do it is to use two external files, one
with the JavaScript (include.js), and one with the HTML for the nav system
(nav.inc). Then, the parent html doc would look like:

<html>
<head>
<title>my content page</title>
 
<script type="text/javascript" src="include.js" />

</head>
 
<body>
<-- #include file="nav.inc" -->

<p>Page Content</p>
</body>
</html>




More information about the thelist mailing list