Collapsible navigation not working when using isInRole handlebars, most of the time

I’m using the Inspinia Theme and Meteor-roles.

I’m using the roles package to show different navigation menus to different users depending on their role. I’m doing this by using the isInRole handlebars which is apart of Meteor-roles (scroll down to “-- Client --” to view this section).

The issue I’m having is whenever I use the isInRole handlebars it stops the collapsible navigation (Example: The “Dashboards”, “Graphs”, Forms" here) from working most of the time. If I click around to a few of my other pages and then go back, or refresh the page a bunch of times then sometimes it’ll start to work, but then I’ll refresh the page and it’ll stop again. Also, if I go directly to one of the pages that is in the collapsed menu (ie. “Users” in my screenshot below) then it stays open and seems to work as it should.

Here’s how I have it setup:

<template name="navigation">
  {{#if isInRole 'admin'}}
        {{> adminNav }}

  {{#if isInRole 'partner'}}
        {{> partnerNav }}

Here’s an example of the adminNav template, I removed a few things to try and make it less cluttered, but it still has the same issues (the collapsible part of it is near the bottom):

<template name="adminNav">
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="sidebar-collapse">

            <!-- Close canvas menu used only on OffCanvas page -->
            <!-- You can remove this tag if you dont use offCanvas menu -->
            <a class="close-canvas-menu"><i class="fa fa-times"></i></a>
            <!-- End offCanvas menu toggle -->

            <ul class="nav metismenu" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="{{currentUser.profile.picture}}" width="48" height="48"/>
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">{{}}</strong>
                             </span> <span class="text-muted text-xs block">{{currentUser.accountType}} <b class="caret"></b></span> </span> </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a href="{{pathFor route='profile'}}">Profile</a></li>
                            <li><a href="{{pathFor route='mailbox'}}">Mailbox</a></li>
                            <li class="divider"></li>
                            <li><a href="{{pathFor route='login'}}">Logout</a></li>
                    <div class="logo-element">

                <li class="{{isActiveRoute regex='/'}}">
                    <a href="{{pathFor route='dashboard'}}"><i class="fa fa-th-large"></i> <span class="nav-label">Dashboard</span> </a>
                <!-- Here is the collapsible part of the navigation -->

                <li class="{{isActiveRoute regex='manage|manage-alerts'}}">
                    <a href="#"><i class="fa fa-gears"></i> <span class="nav-label">Manage</span><span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse {{isActiveRoute regex='manage|manage-alerts' className='in'}}">
                        <li class="{{isActiveRoute regex='manage'}}"><a href="{{pathFor route='manage'}}"><i class="fa fa-users"></i> Users</a></li>
                        <li class="{{isActiveRoute regex='manage-alerts'}}"><a href="{{pathFor route='manage-alerts'}}"><i class="fa fa-bell"></i> Alerts</a></li>



Any assistance here would be greatly appreciated, I’ve searched around quite a lot but can’t seem to find any info on why this might be doing this or how I can solve this issue.

We are using the same theme and same package. Had similar problems before but got it fixed, cannot remember what was the final fix. But I think it was something related to isInRoles doing the check and roles were not yet loaded or user profile was not loaded so it didn’t render anything. Can check back tomorrow to see if I can find more information on that.

Thanks for the reply, I’ll continue to play around with it and see if I can get something to work, if you find out anymore info on how you got it working I’d love to hear it. Thanks!

Bump. Still having troubles finding a way to make this work, if anyone has any ideas I’d love to hear them and would greatly appreciate it.

Bump. If anyone has any ideas I’d love to hear them.

Think I have the same problem. Haven’t any solution yet… Works sometimes and not others…


Old post, I avoided it for a while by not using a dropdown but now I need to use this so if anyone happens to know of a way I can fix this I would love to hear about it. Thanks!