3

I am using the "Bootstrap Accordion Menu" Plugin. I have 4 Modules implemented because i am using 2 languages and have different positions for the mobile version. On the German version the menu module works fine, however, on the English version it does not. I have checked all settings, tried to copy the working one .. but on the english version the page is not loaded with the top menu items that are also a parent. (Profile, Expertise, References ..)

Do you have any idea why this could be? I have tried to create a separate mod_menu for the english menu, but this won't work. since i have double checked all settings to the working (german) menu, i have no clue why this issue comes up. This is the mod_bootstrap_accordionmenu code.

<?php
/**
 * Joomla! module - Bootstrap Accordion Menu
 *
 * @author Yireo (info@yireo.com)
 * @copyright Copyright 2012 Yireo.com. All rights reserved
 * @license GNU Public License
 * @link http://www.yireo.com
 */

// Deny direct access
defined('_JEXEC') or die;
?>
<?php if($params->get('load_js', 1) == 1) : ?>
<script type="text/javascript">
if (typeof modBootstrapAccordionMenu_hover === "undefined") {
  var modBootstrapAccordionMenu_hover = <?php echo (int)$params->get('js_hover', 0); ?>;
}
</script>
<?php endif; ?>
<div class="accordion" id="<?php echo $tag_id; ?>">
    <div class="accordion-group">
        <?php foreach($parents as $parent) : ?>
        <?php $collapse_status = ($parent->active) ? 'in' : 'out'; ?>
        <div class="accordion-heading">
            <?php if(!empty($parent->childs)) : ?>
            <a class="accordion-toggle menulist accordion-parent <?php echo implode(' ', $parent->classes); ?>" data-toggle="collapse" data-parent="#<?php echo $tag_id; ?>" data-href="<?php echo $parent->href; ?>" href="#<?php echo $parent->html_id; ?>"><?php echo $parent->title; ?><i class="fa fa-chevron-down pull-right"></i></a>
            <?php else: ?>
            <a class="menulist accordion-toggle <?php echo implode(' ', $parent->classes); ?>" href="<?php echo $parent->href; ?>"><?php echo $parent->title; ?></a>
            <?php endif; ?>
        </div>
        <?php if(!empty($parent->childs)) : ?>
        <div id="<?php echo $parent->html_id; ?>" class="accordion-body collapse <?php echo $collapse_status; ?>">
            <div class="accordion-inner">
                <?php modBootstrapAccordionMenuHelper::submenu($parent->childs); ?>
            </div>
        </div>
        <?php endif; ?>
        <?php endforeach; ?>
    </div>
</div>
2

This would be a comment but don't have enough reputation.

Seems like your english links are missing event listeners for "div.accordion-heading" (default.js line 12) and a click event from default.js (line 27) if you check them out with firebug "Events". And if this is only in the english side, I would check to see if you have and english "default" menu or have published the accordion menu on the english menu side also. Or something that would be the cause for not calling those event binders.

  • thanks for your reply. the english menu has a default menu and the english menus are their own modules which are assigned to the english menu entries .. this is all analog to the german version. do you have any idea why those event listeners are missing? i mean i have just duplicated stuff, i can't imagine how the went lost .. do i need to modify the default.js file? in which way? i am not firm enough with js – Dieter05 Jan 15 '15 at 12:02
  • seems like the german sites "Mobile menu" (line 85 from page source code) returns 1 from the echo (int)$params->get('js_hover', 0);and that is the reason the default.js script gets run. but your english sites mobile menu return 0. Which is why the default.js never runs. – wouho Jan 16 '15 at 9:27
0

i have solved the problem with a little trick now. maybe it could be solved in a better way by tweeking the js code, but i came up with another solution, that might point out to a "bug" or something in that module.

the problem was caused by having two menus with the same options in backend. i have had Load js "on" load hover "off" on both menus. when i changed the mobile menu to Load js on and load hover on, the menu would load correct again. and the weirdest part about it is, that in the mobile menu the hover effect isn't even working (just like i wanted) so now it works as i want it to .. but was kind of random succes / try and error ..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.