Hi everyone,

Can you help me integrate OM Maximenu into AT Commerce?

I've tried following the OM Maximenu instructions which are:-

Main Menu - You have the option to make this as your main menu.
This will automatically replace existing main menu for OM Base Theme.
For other themes, add this print $main_menu_tree; to your page.tpl.php

Which I did in page.tpl.php on line 57

New code:-
<div id="menu-wrapper"><?php print $main_menu_tree; ?></div>

Original code:-
<div id="menu-wrapper"><?php print render($page['menu_bar']); ?></div>

Which places the menu items into the menu bar. But they render without a background, and they do not have the normal vertical stacking behaviour when viewed on a mobile device. See attached screenies, two of the default menu, and two of the OM Maximenu.

AT Commerce - Horizontal.png
AT Commerce - Vertical.png
OM Maximenu - Horizontal.png
OM Maximenu - Vertical.png

You can see these live at, default http://www.johnflower.info/dev and OM Maximenu http://www.johnflower.info/dev2

The reason I'm using OM Maximenu is that it supports jquery Menu, for expanding menu child links. Menu Minipanels doesn't.

Regards,
John

Comments

stan turyn’s picture

What is it that you need help with? Seems like everything is working and you just need to style it.

johnflower’s picture

Hi Stan,

I'm not sure where to begin with styling. I know how to change the CSS to make the background black. But I don't know how to keep the OM Menu within the container. Can I do everything with CSS? Or do I need to play with php either in page.tpl.php or template.php?

The OM main menu doesn't transition correctly from horizontal to vertical. See below:-
OM Maximenu doesn't form a vertical stack nicely

Possibly Jeff Burnz suggestions for Menu Minipanels, using hook_page_alter(), might work? I did try them with Minipanels, but I got a function error. And Minipanels doesn't play nice with DHTML or jquery Menu modules.
http://adaptivethemes.com/menu-minipanels-in-adaptivetheme-instant-mega-...
Although I'm not sure where to find the machine name for my OM Maximenu.

Another reason I discounted Minipanels is that I couldn't get them to activate using touch on Android (version unknown). I also tried superfish but couldn't get it to activate via touch either. But even if Superfish did work I'm not so keen on how it puts out menus. I also looked at Gigamenu and Muchomenu. No joy with Giga, and I didn't try Muchomenu because it relied on Mini Panels.

Any suggestions?

Regards,
John

johnflower’s picture

I'm getting some joy playing with CSS.

.om-maximenu.om-maximenu-main-menu ul.om-menu li.om-leaf .om-link {
    color: #FCFCFC;
    background: none;
    display: block;
}

#menu-wrapper {
    color: #666666;
    background-color: #212121;
}

Gets me:-

With some CSS in horizontal layout With some CSS in vertical layout

Which is good. I can work with colours and fonts. Is CSS my route to get the menu items to stay within the menu wrapper?

johnflower’s picture

Perhaps the key is in /sites/all/themes/at-commerce/css/responsive.smartphone.portrait.css and the other responsive.css files and using them to create css for OM Maximenu? Perhaps with:-

@media only screen and (max-width: 480px) {

}

Am I on the right track?

stan turyn’s picture

You are on the right track. If I were you, at that mobile breakpoint I would remove that dark back ground from menu bar and add backgrounds to

  • 's in the menu.
  • johnflower’s picture

    StatusFileSize
    new14.45 KB

    CSS study time it is. I've made a little progress. I have a few overflow issues to work through, the OM Maxi Menu needs to appear on top of the other menu items, and the screen break points need tinkering. I'll get there. I haven't yet seen what AT Commerce's CSS does for it's native menu, maybe that'll throw me a bone.

    The following code...

    @media only screen and (max-width: 524px) {
    .om-maximenu.om-maximenu-main-menu ul.om-menu li.om-leaf .om-link {
        background: none repeat scroll 0 0 #212121;
        width: 300px;
        max-width: 100%
    }
    
    #menu-wrapper {
        background: none;
        box-shadow: none;
        top: 1em;
    }
    }

    ...gets me:-
    Progress

    johnflower’s picture

    Still having trouble getting the maximenu to appear above the other menu links. Inspired by Jeff's post on Twitter style Login box, I tried:-

    .om-maximenu.om-maximenu-main-menu .om-maximenu-content {
      position: absolute; 
      z-index: 999; 
    }

    But no joy. Any ideas?

    Jeff Burnz’s picture

    Is it on the web johnflower?

    johnflower’s picture

    Hi Jeff,

    Thanks for looking in on this. My experimental site is:-

    http://johnflower.info/dev2

    CSS aggregation is off.

    I'm not sure whether it is better to push the other menu items down, or just to overlay the Maximenu. I suspect the former.

    BTW using your Sky theme at http://johnflower.org and wrote about how your theme helped me to make my site responsive at http://johnflower.org/blog/responsive-web-design-drupal

    Regards,
    John

    johnflower’s picture

    Worst case... can move the Products item to the end of the menu, then the dropdown works fine.

    Worst case, move Products to the end
    But having it at the top is better for search engines. In which case displacing the other menu items would be best when in the vertical configuration.

    johnflower’s picture

    Two hours later. No progress. I'm going to have another go with minipanels.

    johnflower’s picture

    This is my second time trying with Menu Minipanels. the first time I gave up because of an error:-

    Attempt to assign property of non-object in ctools_block_content_type_render()

    Which was raised as an issue at:-
    http://drupal.org/node/1739718
    and now has a solution, today it is patch or upgrade to dev version.

    I also discounted it because i couldn't get jquery/dhtml expanding menus... but I now think this is not important. So the last thing is to figure out how to show the dropdown when tapping on the menu title. Possibly the Special menu items module is the way.

    johnflower’s picture

    Status: Active » Closed (won't fix)

    I've decided to struggle with OM Maximenu no longer. It will take me too long to figure out how to make it work. I'm working with Menu Minipanels instead. Cheers Jeff and Stan.

    johnflower’s picture

    Issue summary: View changes

    Corrected spelling