Mega Menu - 5.5.1?

Permalink
Anyone successfully used Mega Menu with 5.5.1? I bought it for a site and it installed ok, and is visible if I make a stack and add a block (ie I can select it from the list of installed blocks) but it is missing from the block list in the Dashboard - Stacks & Blocks > Block Types.
Also, if I display the stack MM is in, the C5 toolbar disappears - but shows the area, just like not putting in the footer required statement.
I use this to display it:

<div id="main-nav">
<?php
$stack = Stack::getByName('main nav');
if($stack){$stack->display();}
?>
</div>

When showing it displays as all text links, not as a menu bar with dropdowns - seems the css is not working?
Their support suggested permissions, but the folder has all the permissions it should need.
Anyone?

 
clintre replied on at Permalink Reply
clintre
I am using it with 5.5.1, have not seen any issues so far.
jb1 replied on at Permalink Reply
jb1
If this is still an issue please submit a support request via the marketplace and I'll get back to you quickly.

JB
arcanepain replied on at Permalink Reply
arcanepain
Yep...i've had this problem too (both with Mega Menu and other blocks). Basically, it would seem that package/block inclusion of custom CSS and Javascript which relies upon C5's automatic inclusion of the /css and /js folders doesn't work when calling in stacks the way you're doing it -- the folders just don't get parsed and the necessary CSS & JS included.

Think this is something to do with the $arIsGlobal boolean when a page is being rendered and all relevant block directories spidered. Solution to this is, sadly, as little beyond me (bigger issue for the core team to tackle at some point) BUT, fortunately, there is an easy fix for the time being: simply include your stacks with the GlobalArea call! In terms of your theme, just swap the static call to Stack with:

$content = new GlobalArea('main nav');
$content->display();

and you *should* be ok. All relevant megamenu CSS and JS will be included. If this doesn't work, you might just need to remake the stack/global area. Delete your stack via the dashboard, then leave it to C5's automatic global area/stack creation when it processes a call to a new global area in your theme on first editing a page containing the new GlobalArea call...once this new GlobalArea is created (which shows up at the top of the stacks page in the dashboard), just add your megamenu and anything else in there. Everything should be included fine from then on!

You'll actually notice that your custom block JS and CSS is included on EVERY c5 page from then on (including dashboard pages, which really doesn't strike me as ideal) but, again, this is probably an issue for the core team to look at (I posted this in the bug tracker already). Either way, should have your global menus working across your site!
JohntheFish replied on at Permalink Reply
JohntheFish
I have a mega menu within a 'Global Header Area' (ie, a stack) in 5.5.1 and it is working correctly with css and scripts.

(PS save for a bug report on some parts of keyboard navigation)
arcanepain replied on at Permalink Reply 1 Attachment
arcanepain
See attached.

All blocks included in stacks configured as a 'Global Area' include custom CSS & JS just fine (albeit on EVERY site page regardless of whether or not they include the Global Area/Stack in question - think this is something to do with global area block header items being initialised for every page header call).

Global Area/Stacks created via the dashboard page (and therefore appearing in 'Other Stacks' in the dashboard list) do NOT include custom JS & CSS as they should...at least not for me. Something is obviously going wrong here.

The difference between a stack listed under 'Global Area' and a stack listed under 'Other stacks' should, as far as I can figure, be trivial...but doesn't seem to be.

Would love to know what mileage you find with this...really threw me at first until I made sense of what was going on via some trial and error. A fix would be great as it's pretty annoying!
arcanepain replied on at Permalink Reply
arcanepain
Done some more poking around here and actually managed to narrow it down some more!

Looks like when you add a Stack to a page Area (whether it be a GlobalArea() created stack or a dashboard page created one) through the page editing UI, it DOES pull in CSS + JS correctly! Obviously physically adding the stack to the page area is enough to initialise the relevant custom CSS & JS for the relevant stack-contained global blocks.

It only doesn't work (ie. doesn't correctly include CSS + JS) when you programatically include:

$stack = Stack::getByName('foo');
$stack->display();

in your themes. Block HTML (view) is rendered just fine...CSS + JS that's supposed to be automatically included is missed. It DOES however work when you use a new GlobalArea() call in the theme because GlobalArea stacks seem to automatically include their CSS + JS on EVERY page of the site (front-end + back-end) regardless of whether or not the blocks/stacks are present on the page. This seems like a bug to me but, assuming no conflicts, has the effect of keeping things working as CSS + JS dependencies are always there, whether or not the relevant HTML is.

In a nutshell, Stacks work perfectly when relying on the UI...currently do some weird things when employed programatically. In particular, Stack::getByName() in themes doesn't seem to work when custom CSS + JS is required. new GlobalArea() in themes does, but only because CSS + JS is automatically included EVERYWHERE.
dmennenoh replied on at Permalink Reply
I'm at this again and still having issues. Have tried using new GlobalArea and MegaMenu still does not work properly. If I login to admin and the dashboard is loaded then MegaMenu works great. So still, even with GlobalArea, something is still not being loaded.

Anyone have an idea?

The site being staged here:
http://66.147.244.109/~bayenvir/...

Thanks for any help
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Looking at the developer console you are getting a script error within jQuery
"Uncaught TypeError: Property '#<Object>' of object #<Object> is not a function"

This is preventing further JavaScipt execution, hence the mega menu script never runs, hence the lack of the slide down parts of the menu.

It could be another bit of script on the page, or it could be that scripts loaded in a sequence that breaks dependencies, or it could be a script that is not being requested/loaded.

From the nature of the error, I would suspect a missing jQuery plugin, or a plugin loaded out of sequence of its dependencies.

(The difference when logged in is that scripts are also loaded for the dashboard, so the sequence is different and others are loaded)
dmennenoh replied on at Permalink Reply
Finally got it - once I compared what js admin was loading, vs what my page alone was loading I noticed my page didn't load jquery.ui.js. I added it to the list and all is well.