Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:01

SSI's in v5


Poster: jwm1205
Dated: Friday October 24 2003 - 15:51:00 BST

I recently created SSIs on my home page however when I reference them in subpages they do not follow.

What is the proper code for referencing a SSI from a single directory throughout my site.

I have created

<!--#include file="header.txt" -->

However, it only works in one directory, is it possible to use the SSI above throughout my site?

Thanks.

Re: SSI's in v5


Poster: John
Dated: Friday October 24 2003 - 17:35:28 BST

jwm1205 wrote:
<!--#include file="header.txt" -->

However, it only works in one directory, is it possible to use the SSI above throughout my site?

It's possible to use anything throughout your site provided it is coded correctly.

In your case, since you said header.txt works on the home page, I have to assume that header.txt is in the same directory as the home page. What you need for the rest of the site (those pages in other directories) is server-relative addressing (this would also apply to the include on the home page). Simply code your include like this...
Code:
<!--#include file="/header.txt" -->

That leading / says look for this file in a location relative to my root server address, regardless of where I'm looking from. So, if your site URL is http://www.mysite.com/, that's where the search for the include begins. Leaving the leading / off says look for the file in the directory I'm in right now, and that is why it's failing for you.

Still having problems...


Poster: jwm1205
Dated: Friday October 24 2003 - 18:15:14 BST

I have tried that. The code I have is as follows on all subsequent pages to my home page:

<!--#include file="/header.txt" -->

However, once I load the page I receive the following error at the top of my page where my header should be placed:

[an error occurred while processing this directive]

The header.txt file is located in my main directory and I am puzzled why it will not duplicate on other .shtml pages within my page. The chmod is 754 for the pages I am trying to access with the SSI.


Poster: John
Dated: Friday October 24 2003 - 18:58:04 BST

Try changing that to /header.htm or .html, whichever you use (not .shtml). Just remembered I was doing the same thing the other day and used .js - got the same exact message you did!


Poster: jkgraham
Dated: Friday October 24 2003 - 20:09:04 BST

To do absolute includes use:

<!--#include virtual="/header.txt"-->

or even better, put all your includes in a separate folder:

<!--#include virtual="/includes/header.txt"-->



-Jon


Poster: Hergio
Dated: Friday October 24 2003 - 21:08:17 BST

yeah ASP pages and the like with automatically parse up and use these includes without any further direction. But because you are using a htm or html file, as John said, you need the s in front so it would be shtml or shtm. The s prefix tells the server before it actually opens the file that there may be includes in the file and it should whip through it and take care of any pre-processing that needs to be done.

I find the same problem


Poster: zjoker
Dated: Saturday January 17 2004 - 5:43:26 GMT

I am having the same problem.
Pages are shtml pages.
ssi is as follows:
<!--#include virtual="/includes/ssi_menu.shtml" -->

With this code it shows the 3 .js files that are saved into the includes file, but will not show the menu on preview.
I uploaded all files just in case it needed to be on server to show..still nothing.

Anymore ideas ?

Thanks for any help.
zjoker

tried everything..still nothing


Poster: zjoker
Dated: Saturday January 17 2004 - 5:51:37 GMT

I just seen the post recommending changing the include from a .shtml file to a htm file...That didn't work either...any more suggestions ?

fixed the problem for future ssi posts


Poster: zjoker
Dated: Saturday January 17 2004 - 19:29:29 GMT

ok..after sleeping on the issue, I have now fixed the problem with using the menu as ssi. I simply added " ../" in front of all .js files that I am calling for.
Example:
<script language=JavaScript src="../menu_data.js" type=text/javascript></script>

This will call for the .js file from the correct location.

This will not display the arrow image or other images added. To fix this problem you can call for the image as an abosolute location file..such as http://mysite/images/arrow.gif

Re: fixed the problem for future ssi posts


Poster: John
Dated: Saturday January 17 2004 - 23:49:40 GMT

zjoker wrote:
ok..after sleeping on the issue, I have now fixed the problem with using the menu as ssi. I simply added " ../" in front of all .js files that I am calling for.
Example:
<script language=JavaScript src="../menu_data.js" type=text/javascript></script>

That's fine unless/until your site (and calls) moves to other levels. Then you're stuck with changing that call to ../../, ../../../, etc.

Re: fixed the problem for future ssi posts


Poster: zjoker
Dated: Saturday January 17 2004 - 23:55:01 GMT

That is true, but that allows me to be able to make changes to my menu for each level rather than each page.
A 6 level website would be able to store 6 menus with various ../../../ for each level represented...Any changes in the futurte would be x6 instead of x1500 (assuming a 1500 page website).