Log in

View Full Version : Include files IN CSS layers



AniG
09-12-2006, 04:06 PM
I have the following code in my html body:
<div id="Layer2">
<!--#include file="service_release/test.htm" -->
</div>
<a href="#" onClick="MM_showHideLayers('Layer2','','show')">Download</a>

<----------------------------->
The style is defined in the head as:
<style type="text/css">
<!--
#Layer2 {
position:absolute;
left:253px;
top:12px;
width:380px;
height:413px;
z-index:1;
background-color:#CCCCCC;
visibility:hidden;
}
-->
</style>

<----------------------------->
The content of my "test.htm" file is exactly the following no body, head,etc.:
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td bgcolor="#999900"><span class="style1">TEST</span></td>
</tr>
</table>
<----------------------------->

I am using dreamweaver 8, everything shows up within the design view...but when I open the page up in IE, the content of the include file simply does not show.

How can I include Files in my CSS layers ?
Thanks

ItsMeOnly
09-12-2006, 05:48 PM
because that's SSI, not clientside inclusion: Either you should use AJAX content embeding, or your host ought to support SSI (I.e being Apache or compatible web server, and have +Includes option enabled, technically you could try creating .htaccess file with this:


<directory />
Options +Includes
</directory>

Furthermore, it may just not want to work out of the box; from my experiences, you might also need XBitHack option enabled, but that's what only your provider can enable.

AniG
09-12-2006, 08:00 PM
Is there another way I can include the file? maybe using javascript within the CSS layer?

ItsMeOnly
09-12-2006, 08:46 PM
AJAX, PHP, <object type=text/html>

AniG
09-13-2006, 12:56 PM
My site is externaly hosted on a windows server.
Maybe another way? through javascript?
But I don't quite get it....

doesn't CSS "allow" includes?

ItsMeOnly
09-13-2006, 06:57 PM
it allows @import rules, but that's for chunks of, for example media specific (print, portables), css styling

What you're mistaking is that it has nothing to do with CSS, nor layer.
You can use ASP directives to include external cunks of HTML on Windows machines, or you can request PHP, which can do it as well... other than that, there's only client-side option I just gave you: AJAX or<object>

mwinter
09-13-2006, 08:13 PM
it allows @import rules, but that's for chunks of, for example media specific (print, portables), css styling

In other words, importing other style sheets. :)



What you're mistaking is that it has nothing to do with CSS, nor layer.

Yes. CSS is for suggesting presentation. The word "layer" means nothing in markup.



You can use ASP directives to include external cunks of HTML on Windows machines, or you can request PHP, which can do it as well... other than that, there's only client-side option I just gave you:

You've neglected to mention SSI (server-side includes), which is independent of any particular language or Web server implementation. There are also other languages besides ASP and PHP.



AJAX or<object>

Except that relying on AJAX isn't a good idea has it has relatively little support across browsers and is subject to security settings in IE. Moreover, the object element isn't well supported for uses beyond plug-ins (which is quite unfortunate). The only practical client-side option is frames (probably in-line frames; the iframe element).

Mike