Quote:
Originally Posted by juggledad
Jerry, I'd like to see this php. Why don't you post it?
|
Well, first of all, I'm not using drop down menus, so I don't know all the code, but here's the concept as I'd approach it. It would require
this advanced technique, including some significant output buffering (if it would even work at all).
First, I'd get a count of the submenu items. Then, assuming thynne.j1's idea of two columns if the count is over 10, I'd run a condition:
then echo each submenu item li styled with:
Code:
style = "float:left; width:50%; white-space:normal;"
(just like categories are laid out in a mz widget, and they'd have to be in some kind of container div, so that the 50% would have some meaning. The white-space:normal style makes them wrap if they're too long; with the default mz styling, menu items don't wrap.)
Code:
else [submenu items echoed without any added style]
I hope this helps. It's only at the level of a sketch on the back of a napkin.
Another, much simpler way, is to hard code a class for the two column dropdown into a template, and add the custom css for that class into the stylesheets. That way, it could be done with no php at all. The only thing that requires php is the condition of the number of menu items which, while you might not know exactly every time, you probably will have some idea if it will be many or few. I'd try that first.