View Full Version : All Level Menus sidebar Server Side Includes

02-12-2009, 11:57 PM
1) All Level Navigation Menus v2.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm

3) Describe problem: I'm new to this script and I've been able to get it to work on a site index page. But I need it to be used in server-side includes because there are too many pages to do individually. The menu has 3 levels and is vertical. I've done includes before and I have an apache testing server setup to parse shtml and html.
Are there any examples or instructions that anybody can provide me with so I can get this worked out? I've been at this all day.
Thank you.

02-13-2009, 12:21 AM
Going by the source of the demo menu page (http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/demo.htm), your goal would just be to put the HTML of the menu (everything that goes in the BODY section) in a seperate file, and then use SSI to dynamically include that page. In other words, this portion:

<div id="ddtopmenubar" class="mattblackmenu">
<li><a href="http://www.dynamicdrive.com">Home</a></li>
<li><a href="http://www.dynamicdrive.com/new.htm" rel="ddsubmenu1">DHTML</a></li>
<li><a href="http://www.dynamicdrive.com/style/" rel="ddsubmenu2">CSS</a></li>
<li><a href="http://www.dynamicdrive.com/forums/">Forums</a></li>
<li><a href="http://tools.dynamicdrive.com/" rel="ddsubmenu3">Web Tools</a></li>

<script type="text/javascript">
ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar|sidebar")

<!--HTML for the Drop Down Menus associated with Top Menu Bar-->
<!--They should be inserted OUTSIDE any element other than the BODY tag itself-->
<!--A good location would be the end of the page (right above "</BODY>")-->

<!--Top Drop Down Menu 1 HTML-->

<ul id="ddsubmenu1" class="ddsubmenustyle">
<li><a href="#">Item 1a</a></li>
<li><a href="#">Item 2a</a></li>

<li><a href="#">Item Folder 3a</a>
<li><a href="#">Sub Item 3.1a</a></li>
<li><a href="#">Sub Item 3.2a</a></li>
<li><a href="#">Sub Item 3.3a</a></li>
<li><a href="#">Sub Item 3.4a</a></li>

<li><a href="#">Item 4a</a></li>
<li><a href="#">Item Folder 5a</a>
<li><a href="#">Sub Item 5.1a</a></li>
<li><a href="#">Item Folder 5.2a</a>
<li><a href="#">Sub Item 5.2.1a</a></li>

<li><a href="#">Sub Item 5.2.2a</a></li>
<li><a href="#">Sub Item 5.2.3a</a></li>
<li><a href="#">Sub Item 5.2.4a</a></li>
<li><a href="#">Item 6a</a></li>


<!--Top Drop Down Menu 2 HTML-->

<ul id="ddsubmenu2" class="ddsubmenustyle">
<li><a href="#">Item 1b</a></li>
<li><a href="#">Item 2b</a></li>
<li><a href="#">Item Folder 3b</a>
<li><a href="#">Sub Item 3.1b</a></li>
<li><a href="#">Sub Item 3.2b</a></li>

<li><a href="#">Sub Item 3.3b</a></li>
<li><a href="#">Sub Item 3.4b</a></li>
<li><a href="#">Item 4b</a></li>
<li><a href="#">Item Folder 5b</a>
<li><a href="#">Sub Item 5.1b</a></li>

<li><a href="#">Item Folder 5.2b</a>
<li><a href="#">Sub Item 5.2.1b</a></li>
<li><a href="#">Sub Item 5.2.2b</a></li>
<li><a href="#">Sub Item 5.2.3b</a></li>

<li><a href="#">Item 6b</a></li>

<!--Top Drop Down Menu 3 HTML-->

<ul id="ddsubmenu3" class="ddsubmenustyle">
<li><a href="http://tools.dynamicdrive.com/imageoptimizer/">Image Optimizer</a></li>
<li><a href="http://tools.dynamicdrive.com/favicon/">FavIcon Generator</a></li>
<li><a href="http://www.dynamicdrive.com/emailriddler/">Email Riddler</a></li>
<li><a href="http://tools.dynamicdrive.com/password/">htaccess Password</a></li>

<li><a href="http://tools.dynamicdrive.com/userban/">htaccess Banning</a></li>

02-13-2009, 12:51 AM
Thank you for the prompt response. I was confused with the direction to put the subs before the closing body tag.
Anyway, using your guide, I was able to get the menu to appear, but it's either not getting the styles or not getting the arrow gif. So, what about the <head> content?

02-13-2009, 01:04 AM
I just got it. I kept changing the path until it worked. thanks

02-13-2009, 01:42 AM
Another issue: would it work easier if I used absolute urls so when I get down into the levels it doesn't get confusing?

02-13-2009, 02:50 AM
It depends. If the links in the drop down menus are relative links to your own pages, and the pages that will display the menu are scattered across different directories on your site, then yes, you should use absolute URLs for the links in the former.

02-13-2009, 03:32 AM
I'm working on a site in development and needing to use includes relative to a temporary directory so it can be changed later. What I've done, with your help in pointing me in the right direction, was to change the paths in the include files to absolute; then when I need to change the root of the site, it will be easier. I also had to change the path of the arrow graphics in the js file to an absolute path so this would work for the site index and the other directories. Thank you so much for your guidance. Much appreciated!