 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
julieanne
Joined: 10 Mar 2009 Posts: 6
|
Posted: Tue Mar 10, 2009 10:34 pm Help with SSI, keep getting error message |
|
|
|
Hi,
I am totally new to HTML and for a class I'm taking, we have to take simple webpages we've made on the school's server and use SSI's to make a left navigation on each of the pages we've made. I've tried so many different ways and every time I tri I get the message "[an error occurred while processing this directive]," i.e. a nice way of saying I don't know SSI The rest of my page renders fine, however. Through coding I was able to make a left navigation but, on two of my pages that are more design/css 'heavy', so to speak, the page renders completely off using the code I wrote for the left navigation. Can anyone help me out?
The assignment said, as follows:
2. To add a server side include (ssi) to this file, you will first have to change its extension to .shtml so that file is parsed by the server before it is sent to the browser.
Now, in order to include another file within your .shtml file, you will have to use an ssi like this:
<!--#include virtual="../../includes/navigation.html" -->
(Make sure the relative path is correct)
2. The structure of each of your existing webpages will need to be modified as follows:
<!-- existing code prior to the body element -->.
<body>
<div class="left">
<!-- call the ssi as described above to include the navigation.html file in this div section-->
</div>
<div class="content">
<!-- all of your existing content within the body element-->
</div>
</body>
</html>
3. Add a css file called common.css to the includes folder. Add to it the styles for left and content such that at the minimum:
the left div section has a width defined and floats from the left
the content div has at least a width and a left margin defined for it.
________
Trying with SSI, my page renders like this:
http://people.ischool.berkeley.edu/~web39/190-02/a2/a22.shtml
Trying with the code I wrote up, I get something like this:
http://people.ischool.berkeley.edu/~web39/190-02/a2/a2.shtml
(if you click on the links to Assignments three and four on the latter link, you can see what I mean by the CSS/design heavy pages not rendering properly at all.
Any tips?
I hope this wasn't too long winded and/or confusing! |
|
sticks464

Joined: 31 Dec 2006 Posts: 2309
|
Posted: Wed Mar 11, 2009 2:58 am |
|
|
|
Make sure the file to include is in the includes folder and try it like this
| Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<title>Julieanne's Favorite courses</title>
<link href="simple.css" rel="stylesheet" type="text/css">
</head><body><div class="left">[an error occurred while processing this directive]</div><div class="content"> <p>These are some of my <strong>favorite</strong> courses that I have taken at <em>Cal</em> thus far.</p>
<dl><dt>My favorite courses</dt>
<dd>
<!--#include file="includes/navigation.html" -->
</dd>
</dl>
<a href="http://delicious.com/julieanne88" title="My delicious">My delicious</a>
<a href="http://validator.w3.org/check?uri=http://people.ischool.berkeley.edu/~web39/190-02/a2/a2.html">Validate</a></div></body></html> |
|
|
julieanne
Joined: 10 Mar 2009 Posts: 6
|
|
sticks464

Joined: 31 Dec 2006 Posts: 2309
|
Posted: Wed Mar 11, 2009 8:38 am |
|
|
|
Most likely it is the path to the included file. Your working files all should be inside a master folder. The master folder will contain the includes folder and the shtml file. The navigation.html file should be inside the includes folder.
The include command does not need any / in the path
| Code: |
| <!--#include file="includes/navigation.html" --> |
|
|
julieanne
Joined: 10 Mar 2009 Posts: 6
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|