Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   2 column drop menu (http://forum.bytesforall.com/showthread.php?t=19567)

thynne.j1 Feb 5, 2013 03:54 PM

2 column drop menu
 
Hi all

I'm currently creating a new website for the school that I teach at using montezuma. So far I'm managing to customise most aspects as I want but I'm struggling with the drop menu or level 2 items. I have one menu with a large number of items which when viewed on a notebook spreads off the bottom of the screen making the menu items inaccessible. What I want is to split a drop menu with over 10 items for example into 2 columns so that they are all visible on screen. Any ideas?

Thanks

juggledad Feb 5, 2013 05:13 PM

you can always go to dashboard->appearances->menus and create the menu you want. Then by adding it into 'Theme position->menu1' it will display in the theme. You could break out the subpages however you want.

jerryc Feb 5, 2013 05:41 PM

Quote:

Originally Posted by juggledad (Post 96137)
you can always go to dashbaord->appearances->menus and create the menu you want. Then by adding it into 'Theme position->menu1' it will display in the theme. You could break out the subpages however you want.

That sounds like a much better solution to me. Making the submenus 2 columns wide, conditioned upon the number of entries, would take a higher level of PHP than would be best to post on this forum.

juggledad Feb 5, 2013 06:38 PM

Jerry, I'd like to see this php. Why don't you post it?

jerryc Feb 5, 2013 07:37 PM

Quote:

Originally Posted by juggledad (Post 96146)
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:

Code:

if ($count > 10)
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.

thynne.j1 Feb 6, 2013 12:02 AM

Thanks for all the replies - what a great, supportive forum

Jerry you have the nuts of what I want to do. I'll see if I can make sense of the coding. I'm not that familiar with php - on a learning curve!

My dev site is www.trinitycatholiccollege.org.uk/index.php the offending long menu is curriculum - too many items for a low screen height

jerryc Feb 6, 2013 12:47 AM

I looked at your site, and it looks like you'll be able to tell which menu items will have many subs and which ones will have few. Therefore, you won't need to programically determine it, so you can skip the php.

Just make a special template, give the long submenu items, such as curriculum, a special class, and style those subs as two column dropdowns.

When you figure this out, please post the code.

Thanks.

juggledad Feb 6, 2013 03:37 AM

Here is another suggestion, why not grouping the subjects by discepline like
HTML Code:

Fine Arts
  Art
  Drama
  Music
Science and Engineering
  Science
  Technology

so the first level would only have
HTML Code:

Fine Arts
Science and Engineering

easy to do, easy to maintain, no coding needed.

thynne.j1 Feb 6, 2013 10:15 AM

Makes sense providing curriculum leaders don't get upset about being catagorised into faculties :)


All times are GMT -6. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.