PDA

View Full Version : Accordion menu and Dreamweaver template



designer222
07-29-2008, 12:10 PM
1) Script Title: Accordion Menu script (v1.5)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm

3) Describe problem: Making it work with a Dreamweaver template.

I have set up the menu and it works fine. However, when I save the page as a Dreamweaver template and then create a page from the template, I am unable to make the menu respond to calls like expand or collapse when the page loads, as the body tag is not editable in the pages from the template. The only editable area is the main content div.

I am trying to avoid using older setups like framesets. Any ideas for a workaround? Thanks.

ddadmin
07-29-2008, 04:39 PM
It shouldn't matter what HTML editor you're using to create your pages when it comes to adding a DD script into it, as long as the editor doesn't inadvertently modify the external script in some way. Please post a link to the page on your site that contains the problematic script so we can check it out.

designer222
07-29-2008, 07:58 PM
I have had some success in getting things working since my post. However, I could still use a little help to get this working the way I need it to. I have studied the examples of oninit() and onopenclose() but am having trouble applying them to my specific situation. I would be grateful for some guidance.

I am using both top level and 2nd level headers; topic, subtopic, sub-sub topic.

I need the selected menu buttons - a subtopic - or if there is a sub-sub topic then that button as well - to highlight (change color) when the associated page loads.

If I jump via link to another topic page, I need the menu to display that button and highlight it so that the menu is in line with the page selected.

Thank you for any and all hep.

ddadmin
07-30-2008, 09:42 PM
This has been discussed a few times on the forums (you may want to do a search). Essentially the issue is that the sub menus are "disconnected" from the headers entirely- the two's only relationship is that the header happens to expand/contract the DIV the sub menu is in. The onopenclose() event handler of the script doesn't really come into play here, as they are tied to the headers, not the sub menus contents.

How to get a particular item within a sub menu to remain highlighted on the target page after it's clicked on is a separate, independent issue actually. How would you get a menu link in general to remain highlighted when the user clicks from pageA to pageB? There are a few solutions discussed on the forums, but it typically involves some server side scripting as well to correctly match up the target page's URL with one of the menu links on the page. Remember, you want the menu link highlighted not just when the user clicks from a link to reach the page, but also when he/she directly calls up the page from the browser location bar.