Comments

kevinquillen’s picture

Status: Active » Postponed (maintainer needs more info)

Is this being worked on?

btopro’s picture

We've got it working in foundation access but it's pretty complicated; mix of knowing the right menu, having a placement on the page and then structuring the menu links to recursively add each other in below the right places.

kevinquillen’s picture

I would say unless a common pattern can be devised enough to implement it cleanly, it's probably too much to get in and have it work for anyone downloading the theme. For instance, without knowing what menu(s) they want to make off canvas, how would you implement the markup and template code to work? What if they didn't want to show menus, but blocks? What about markup for menu block menus? Taxonomy menus?

btopro’s picture

ya it would have to be block settings which would be looked at and applied. Basically blocks as menu blocks.

Example through the spaghetti but we've got it in there for a left menu area -- https://github.com/drupalprojects/foundation_access/tree/7.x-5.x

I tried (at one time) to make it so every block that showed up in the left that was a menu functioned that way and it 1 didn't work well and 2 started applying the styling everywhere regardless of block placement :\

museumboy’s picture

Is there no module that allows for fine control of menu ULs? I tried menu_attributes but that did not work for this.

btopro’s picture

to my knowledge no, Hence custom implementation in our theme / subtheme template.phps. hook is easy enough to implement but yea, annoying that its needed.

Better alternative to providing a solution could be to provide an example. Unfortunately the logic is pretty intense to do it correctly (or at least what we had to construct was) because of how the structure is nested in zurb to make it happy.

This does the bulk of the work for main_menu -- https://github.com/drupalprojects/foundation_access/blob/7.x-5.x/templat...

ykyuen’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new13.6 KB

Recently i tried to implement the off-canvas menu to my drupal projects and here is a patch. It added a Foundation Tab Bar fieldset where you can enable the Tab Bar (Off-Canvas menu) there. It allows to use both left and right off-canvas menus and you can select up to five menus for each side. The off-canvas menus would be shown only in mobile view (small viewport in media qurey). You have to also change the Foundation Top Bar settings to either "Never" or "Tablet and Desktop only". ex

1. If you enable tab bar and set "Never" to top bar. The front end will show the ordinary menu for tablet and desktop views while off-canvas menu in mobile view.
2. If you enable tab bar and set "Tablet and Desktop only" to top bar. The front end will show the Top Bar menu for tablet and desktop views while off-canvas menu in mobile view.

The logic for picking different menus out of ordinary drupal menu, top bar and off-canvas could be improved. but I try to avoid making changes to the original code. If you guys like it, i could re-structure the logic to make it simpler.

Please feel free to comment and it would be great if this feature could be added to the official release.

zonesny’s picture

+1

Thanks ykyuen!! I successfully applied your Off-Canvas patch (zurb_foundation-implement-off-canvas-mult-level-menu-2413213-0.patch in #7) via git against 7.x-5.0-rc4+5-dev (with only a "warning" about trailing whitespace). It works perfectly for the tab-bar for my subtheme. The only wrinkle for me, is that I have a lot of links in my submenu, so I may need to add a scrollbar to the off-canvas menu.

NOTE: For anyone using it in a subtheme, after applying the patch to the base zurb-foundation theme, you'll need to modify your .info file (add the tab-bar settings i.e. settings[zurb_foundation_tab_bar_enable] = 0, etc.) and page.tpl.php template (add the "if ($tab_bar) block of code"), then update your admin/appearance/settings per ykyuen's instructions above.

zonesny’s picture

Quick update:

Ykyuen's patch (which works nicely!) adds the off-canvas (i.e. Tab Bar) settings to the parent theme's .info file (zurb_foundation.info). I had added it to my subtheme's .info as well, to allow configuration via the subtheme. However, it looks like you must only use the theme configuration screen (i.e /admin/appearance/settings/SUBTHEME), as changing tab bar settings in the subtheme's .info file has no effect.

In other words, apply the patch, modify your page.tpl.php template, then configure the settings in the admin/appearance/settings/SUBTHEME via the Tab Bar fieldset.

i.e.
settings[SUBTHEME_tab_bar_right_first] = 'user-menu' //This will have NO effect

perarg’s picture

Hello,
i use zurb foundation 7.x-5.0-alpha4. I applied the patch (i think successfully). I can see in base theme-settings.php the Foundation Tab Bar. (Off-Canvas menus) declarations. The are changes also happened in theme.info file. So i think everything is patched correctly. I clear all caches (drush cc all). In admin/appearance/settings/zurb_foundation there is not Tab Bar section... not in my sub theme neither. Do you have any idea why i cannot see the settings in my administration area ?

ykyuen’s picture

Hi Perarg,

The patch works in the dev release. I am not sure if it will work on the stable release as i haven't tried it.

Could u switch to the dev release and try again?