I have started building a simple plugin to eliminate the default Elgg menu and embed a jQuery-based megamenu (see earlier related discussion).
I built a separate .php file outside of Elgg that creates the menu, then in my plugin I use PHP curl to grab the source code from that external page and embed it into my Elgg system.
The problem is, I can't find a way to bind my menu to the existing jQuery within Elgg. I temporarily tried embedding a jQuery lib into the page I curl in, and that worked. However, as expected, having a duplicate copy of jQuery caused a conflict in certain other Elgg parts that use jQuery.
In my menu, I use the jQuery NoConflict mode, if that may have bearing on this issue.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- DhrupDeScoop@Dhrup2000

DhrupDeScoop - 0 likes
- Paul in Boise@PaulInBoise

Paul in Boise - 0 likes
- ihayredinov@ihayredinov

ihayredinov - 0 likes
- Paul in Boise@PaulInBoise

Paul in Boise - 0 likes
- Paul in Boise@PaulInBoise

Paul in Boise - 0 likes
- Paul in Boise@PaulInBoise

Paul in Boise - 0 likes
- DhrupDeScoop@Dhrup2000

DhrupDeScoop - 0 likes
- Paul in Boise@PaulInBoise

Paul in Boise - 0 likes
You must log in to post replies.What is this jQuery 'MegaMenu' called - can it be downloaded 'somewhere' to test with ?
Thank you for replying. I got it here: http://www.javascriptkit.com/script/script2/jkmegamenu.shtml
Since my original post I have been dissecting the code and found it isn't simply having a redundant jQuery lib. Something within the megamenu javascript is the trigger. The symptom I am seeing is that a MultiSelect field created by the Profile Manager plugin disappears from the form when my menu plugin is active.
I think it may be a CSS conflict, if not jQuery. With my menu plugin active, if I view the Elgg registration form's source code, the MultiSelect field code is there as expected. This leads me to think there may be a conflicting CSS selector or class set to display:none in the menu code.
Have you tried elgg.provide() method?
I had not seen elgg.provide() yet. I'm still very new to Elgg. I see references to it at http://docs.elgg.org/wiki/Javascript/Extending and http://docs.elgg.org/wiki/Javascript/BuiltInFeatures so will start researching. Thanks for the tip.
In searching for a clue, I found this on line 39 of the Profile Manager plugin's views/default/input/multiselect.php file.
It appears that multi-select fields are hidden by default, then made visible somehow with js?
UPDATE:
I have narrowed the problem down to the menu javascript file calling jQuery.noConflict(); . If I disable that line and upload the menu js, Elgg's Profile Manager field appears normally and no js errors are detected in Firebug.
With noConflict set, Firebug was showing this error:
I'll keep looking, starting with elgg.provide
I found that once I disabled the jQuery.noConflict() call, I no longer had to append my separate instance of jQuery. Everything seems to be working properly now. I'll send it out for testing again.
you've been doing a lot of code effort for something that elgg has already built-in facilities for ;) rel='popup' - the way the popup login works ;) http://community.elgg.org/pg/pages/view/789491/elgg-18-ui-experiments has some notes on preliminary tentative code done in this area. that 'megamenu' pulldown is simply same as what elgg's rel='popup' facilitates - with no hassling about jquery conflicts and such..;-P
Thank you. I'll review your link and keep building on my Elgg knowledge. My primary goal in choosing the method I described was to have only one menu to manage for both our primary site and the Elgg network.