Skip to main content
Inspiring
November 19, 2007
Question

Spry menu as SSI? Can it be done?

  • November 19, 2007
  • 3 replies
  • 479 views
Hi All,

I would like to have my Spry horizontal menu bar as a server side
include. My question is, what lines of code need to be in the include
file? From what I see in the code, the head section contains the link
to the JavaScript and the stylesheet; the body contains the ul and li of
the menu items; and at the bottom of the body is the call to the
JavaScript.

Any help would be appreciated.

Brett
This topic has been closed for replies.

3 replies

Inspiring
November 21, 2007
Thanks Matthew.

I also posted on the DW General forum and received the answer I was
looking for. If you are interested you may want to read the reply I
received from David Powers.

Brett
Inspiring
November 21, 2007
This is from an include with spry in it. I thought it might be clearer than the one I posted late last night. It has ASP content and Javascript, but the javascript that operates the spry effect is a seperate file again which is referenced in the include file.

<!--#include file="Connections/CharonCart.asp" -->
<%
Dim rs_lifestylegoodfood
Dim rs_lifestylegoodfood_cmd
Dim rs_lifestylegoodfood_numRows

Set rs_lifestylegoodfood_cmd = Server.CreateObject ("ADODB.Command")
rs_lifestylegoodfood_cmd.ActiveConnection = MM_CharonCart_STRING
rs_lifestylegoodfood_cmd.CommandText = "SELECT * FROM Lifestyle WHERE LifestyleSection = 'GOOD food' AND LifestyleDisplayStatus = Yes ORDER BY LifestyleID DESC"
rs_lifestylegoodfood_cmd.Prepared = true

Set rs_lifestylegoodfood = rs_lifestylegoodfood_cmd.Execute
rs_lifestylegoodfood_numRows = 0
%>
<%
Dim blah blah blah

All of my ASP code here…

%>
<!-- THIS IS WHERE YOUR CONNECTION TO SPRY JAVASCRIPT AND SPRY STYLE SHEET IS -->
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
blah blah blah

All my Javascript code here…

}
//-->
</script>

<body onLoad="MM_preloadImages('_images/ls-bar-littlepeanuts-over.gif' blah blah blah)">

<div id="Accordion1" class="Accordion" tabindex="0">
<div class="AccordionPanel">

All my normal html coding here including javascript for rollovers and ASP content…

blah blah blah


-->
<script type="text/javascript">
<!--
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
//-->
</script>
<%
rs_lifestylegoodfood.Close()
Set rs_lifestylegoodfood = Nothing
%>
Inspiring
November 21, 2007
This is straight from an include I have. It holds code for a recordset and javascript:

<%
Dim rs_subcatList
Dim rs_subcatList_cmd
Dim rs_subcatList_numRows

Set rs_subcatList_cmd = Server.CreateObject ("ADODB.Command")
rs_subcatList_cmd.ActiveConnection = MM_CharonCart_STRING
rs_subcatList_cmd.CommandText = "SELECT * FROM Categories WHERE ParentiD = 1 ORDER BY CategoryID"
rs_subcatList_cmd.Prepared = true

Set rs_subcatList = rs_subcatList_cmd.Execute
rs_subcatList_numRows = 0
%>
<%
Dim RepeatSubCat__numRows
Dim RepeatSubCat__index

RepeatSubCat__numRows = -1
RepeatSubCat__index = 0
rs_subcatList_numRows = rs_subcatList_numRows + RepeatSubCat__numRows
%>

<body>
<table width="156" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="1boys.asp"><img src="_images/but-boys-col.jpg" alt="Boys" name="Boys" width="156" height="65" border="0" id="Boys" onMouseOver="MM_swapImage('Boys','','_images/but-boys-col.jpg',1)" onMouseOut="MM_swapImgRestore()" /></a></td>
</tr>
<tr>
<td><table width="156" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="_images/bar-EBECF5-top.gif" width="156" height="5"></td>
</tr>
<tr>
<td><table width="156" border="0" cellspacing="0" cellpadding="5">
<tr>
<td bgcolor="#CCCCCC">
<p class="navlinks">
<%
While ((RepeatSubCat__numRows <> 0) AND (NOT rs_subcatList.EOF))
%>
<a href="1boysdrill.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "MCID=" & rs_subcatList.Fields.Item("CategoryID").Value %>"><%=(rs_subcatList.Fields.Item("Category").Value)%></a><br>
<%
RepeatSubCat__index=RepeatSubCat__index+1
RepeatSubCat__numRows=RepeatSubCat__numRows-1
rs_subcatList.MoveNext()
Wend
%>
<a href="1boysdrill.asp?MCID=1">Boys - all products</a>
</p>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%
rs_subcatList.Close()
Set rs_subcatList = Nothing
%>


AND, I have just noticed that it has an opening body tag, but no closing body tag, yet it still works fine! I've edited it a bit, so copying this may make the table collapse when pasted in DW, but you get the idea.

Mat