Drew Wutka
DWUTKA at Marlow.com
Fri Dec 14 12:04:15 CST 2007
Here's our siteheader.asp file, which is part of every page on our site
(as an include). It shows how the SiteNav2006.dll is used:
<%
dim NavNodes
dim NavNode
dim rtNode
dim subNavNode
dim intMenuOverflow
dim intTotalRun
dim intNavCounter
dim strCurrentURL
dim CurrentNode
dim tbi
dim tbintTitleFontSize
set NavNodes=server.CreateObject("SiteNav2006.Nodes")
set NavNode=server.CreateObject("SiteNav2006.Node")
set subNavNode=server.CreateObject("SiteNav2006.Node")
set rtNode=server.CreateObject("SiteNav2006.Node")
set CurrentNode=server.CreateObject("SiteNav2006.Node")
set rtNode=NavNodes.RootNode
strCurrentURL=mid(request.ServerVariables("URL"),2)
'if
NavNodes.GetPageFromURL(CurrentNode,mid(request.ServerVariables("URL"),2
)) then
if request.QueryString("ProductID")<>"" then
set CurrentNode=NavNodes.GetPageFromURL(cstr(strCurrentURL &
"?ProductID=" & request.QueryString("ProductID")))
else
if request.QueryString("ProductType")<>"" then
set
CurrentNode=NavNodes.GetPageFromURL(cstr(strCurrentURL & "?ProductType="
& request.QueryString("ProductType")))
response.Write strCurrentURL
response.Write request.QueryString("ProductType")
else
if request.QueryString("ProductList")<>"" then
set
CurrentNode=NavNodes.GetPageFromURL(cstr(strCurrentURL & "?ProductList="
& request.QueryString("ProductList")))
'response.Write strCurrentURL
'response.Write
request.QueryString("ProductList")
else
if request.QueryString("AppCode")<>"" then
set
CurrentNode=NavNodes.GetPageFromURL(cstr(strCurrentURL & "?AppCode=" &
request.QueryString("AppCode")))
else
if request.querystring("View")<>"" then
set
CurrentNode=NavNodes.GetPageFromURL(cstr("sitemap.asp?View=ChildBullets"
))
else
if
strCurrentURL="ContactUs/submitcontact.asp" then
set
currentnode=navnodes.getpagefromURL(cstr("ContactUs/contact_us.htm"))
else
if
instr(1,strCurrentURL,"ShoppingCar")>0 then
set
CurrentNode=NavNodes.GetPageFromURL(cstr("ShoppingCart/useraccount.asp")
)
else
set
CurrentNode=NavNodes.GetPageFromURL(cstr(strCurrentURL))
end if
end if
end if
end if
end if
end if
end if
tbi=len(currentnode.Title)
tbintTitleFontSize=6
if tbi>25 then
if tbi>35 then
if tbi>50 then
if tbi>65 then
tbintTitleFontSize=2
else
tbintTitleFontSize=3
end if
else
tbintTitleFontSize=4
end if
else
tbintTitleFontSize=5
end if
end if
'end if
%>
<%if strCurrentURL=rtNode.URL then%>
<form name="SearchForm" method="POST" action="../search.asp">
<div id='topbar' class="MarlowBar" style="width:100%"> </div>
<table width="100%" border=0>
<tr>
<td width="25%"> </td>
<td align=center
background="/images/homepagebackground.jpg"><img
src="/images/homebanner.gif"></td>
<td width="25%" valign=bottom align=right>
<%if BadLogin=False then%>
<font size="1"><a
href="/ShoppingCart/useraccount.asp">Your Account</a></font>
<%else%>
<font size="1"><a
href="/ShoppingCart/login.asp">Login</a> </font>
<%End if%>
<input type="Text" size="12"
name="SearchString">
<input type="Submit" name="Search"
value="Search">
</td>
</tr>
</table>
</form>
<%else%>
<div id='topbar' class="MarlowBar" style="width:100%;text-align:center">
<a class="MarlowButton" href="http://www.ii-vi.com">A SUBSIDIARY
OF II-VI</a>
</div>
<form name="SearchForm" method="POST" action="../search.asp">
<table width="100%" border=0 cellspacing="0" cellpadding="0">
<tr>
<td width="20%">
<img border="0" src="/images/coolinglogo.gif">
</td>
<td width="80%" height=65>
<table width="100%" height=10 border=0
cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign=top
align="right" style="color: #000000; font-size: 8pt" >
<%=NavNodes.ReverseNavByURL(mid(request.ServerVariables("URL"),2))%>
</td>
</tr>
</table>
<table width="100%" height=55 border=0
cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign=bottom>
<table width="100%"
border=0 cellpadding="0" cellspacing="0">
<tr>
<td
width="75%" valign=bottom align=center>
<nobr><font face="Arial"
size="<%=tbintTitleFontSize%>"><%=CurrentNode.Title%></nobr></font>
</td>
<td
width="25%" valign=bottom align=right>
<%if
BadLogin=False then%>
<font size="1"><a href="/ShoppingCart/useraccount.asp">Your
Account</a></font>
<%else%>
<font size="1"><a href="/ShoppingCart/login.asp">Login</a> </font>
<%End
if%>
<input type="Text" size="12" name="SearchString">
<input type="Submit" name="Search" value="Search">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<%end if%>
<div class="MarlowBar" style="width:100%;text-align:center">
<%if strCurrentURL<>rtNode.URL then%>
<a class="MarlowButton" href="/">HOME</a>
<%end if%>
<%for each NavNode in rtNode%>
<%if NavNode.URL<>"ShoppingCart/useraccount.asp" then%>
<a class="MarlowButton" href="/<%=NavNode.URL%>"
<%if NavNode.ChildCount>0 then%>
onmouseover="menuButtonMouseOver(event,
'menu<%=NavNode.Title%>');"
<%end if%>
><%=UCase(NavNode.Title)%></a>
<%end if%>
<%next%>
</div>
<%for each NavNode in rtNode%>
<%if NavNode.ChildCount>0 and
NavNode.URL<>"ShoppingCart/useraccount.asp" then%>
<div id='menu<%=NavNode.Title%>' class="MarlowMenu">
<%for each subNavNode in NavNode%>
<a class="MarlowMenuItem" href="/<%=subNavNode.URL%>"
onmouseover="MenuMouseOver(event)"
><%=UCase(subNavNode.Title)%></a>
<%next%>
</div>
<%end if%>
<%next%>