WebsiteBaker Support (2.8.x) > Templates, Menus & Design

show_menu2: valid XHTML and CSS selectable menus

<< < (9/64) > >>

ruebenwurzel:
Hello,

this is a new clean WB 2.6.2 installation and your script works perfectly till version 2.5.


--- Quote ---I don't see how this is different from http://riseup.co.nz/pages/flidget.php
It has no subpages, yet there is no error from it.
--- End quote ---

The different is your complete Site structure has subpages. My problems are only with homepages wich have in the complete site structure no subpages. Hope this is more understandable.

Try a new clean WB installation and make only a few pages with no subpages and then try your show_menu2.

Looked at the page_trail database. So it seems that subpages have two entries (the root and the subpage) and root pages only have one entry. Could it be that your script needs a second entry on one page otherwise it produces an error? Thanks for your help. 

Matthias

brofield:
Ok. I found the problem you were running into. It was only NOTIFY errors that were being produced, so the original version should have still worked, just noisily. I put up a new version of 2.6 which should solve the problem.

Cheers,
Brodie

ruebenwurzel:
Hello,

Thank you for this fantastic snippet. Version 2.6 works like a charm, i love it.

Matthias

Tim:
Hi Brofield,

I've implemented this snipped like you suggested in the other thread and it's working like a charm - however I have run into one small issue.

If you look at http://timtekindustries.com/wb you can see that the children (under Home) are formatted (using divs) so that they have a white left border, are indented and are in normal weighted text.

However if you click on one of those children the code that this snipped generates means that they are no longer classed as children for some reason and so they lose this formatting. However ideally I'd like for them to always maintain this bordered/indented formatting regardless of whether they are the current page or not - they're still children of the parent, but for some reason the code that show_menu2 outputs doesn't give them a child class.

Is there any way to get around this? I'm calling show_menu2() with no parameters, btw.

Thanks,
Tim

brofield:
What you are wanting to do is format the menu depending on if it has children or not (independent of what the current page is). The menu-child class indicates that the item is a child of the current page. You want to use the menu-expand class instead, which indicates that it has children. The trouble is, by using divs for both menus and menu items, it is hard to style it correctly. Add a custom class to either a menu or an item so that you can determine which one it is, or better go back to using UL/LI.

Something like...

div.menu-top { /* top level formatting */ }
div.menu-expand > div.item { /* indent formatting */ }

Menu's really fit the UL/LI structure best.

ul.menu-top { /* top level formatting */ }
ul.menu-top ul { /* sub level formatting */ }

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version