PDA

View Full Version : Create Menu as a SSI


Alan Shaw
06-08-2009, 12:31 AM
Not quite got to grips with this, I'd like to use the menu as a SSI instead of having to update every change on every page, but how is this achieved?

Under normal circumstances I would create the include page after first removing all the Header and Body tags, but Menu Writer does not seem to work on a blank page without the 'Body' tag.

If I were to 'cut n paste' the menu from an existing page, how much of the code needs to be included in the 'include' page?

This is an abbreviated menu:

<ul class="level-0" id="cssmw">
<li><span><a href="index.html">Home</a></span></li>
<li><span><a href="about.html">About Us</a></span></li>
<li><span><a href="#">Contact Us</a></span>
<ul class="level-1" id="cssmw">
<li><a href="forms/genenq.html">General Enquiry</a></li>
<li><a href="forms/newenq.html">New Enquiry</a></li>
<li><a href="forms/existenq.html">Existing Enquiry</a></li>
</ul>
</li>
</ul></li>
</ul>

But then just below this code is this:

<script type="text/javascript">if(window.attachEvent) { window.attachEvent("onload", function() { cssmw.intializeMenu('cssmw'); }); } else if(window.addEventListener) { window.addEventListener("load", function() { cssmw.intializeMenu('cssmw'); }, true); }</script>

And in the 'Head' there is this:

<script type="text/javascript" src="CSSMenuWriter/cssmw/menu.js"></script>

<style type="text/css" media="all">
<!--
@import url("CSSMenuWriter/cssmw/menu.css");
-->
</style>
<!--[if lte IE 6]>
<style type="text/css" media="all">
@import url("CSSMenuWriter/cssmw/menu_ie.css");
</style>
<![endif]-->

So, how can I achieved using the Menu as a SSI?

Ray Borduin
06-08-2009, 07:02 AM
I suppose you could use three separate SSI's.... but really the only thing that might conceivably change is the <ul>...</ul> tag, so maybe just move that to an SSI and place the other code on pages individually when you add the SSI reference. They are all external references to .js and .css pages that already have global scope so you wouldn't need to change them on every page once added.