Apply enable-menu-with-back-views only to one side menu, not all of them

Hello,

I’ve got an app that’s going to have 2 side menus: a left one (shown only in root view) and a right one (shown only in certain views). I want the left side menu to have enable-menu-with-back-views=“false”, but the right one should have it set to true. The problem is that this attribute belongs to ion-side-menus directive, so the same value is applied to both menus.

Is there any way to have different behaviour in each side menu?

This is the menu template:

<ion-side-menus enable-menu-with-back-views="false">

    <ion-side-menu-content>

        <ion-nav-bar class="bar-content">
            <ion-nav-back-button></ion-nav-back-button>
            <ion-nav-buttons side="left">
                <button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
            </ion-nav-buttons>
            <ion-nav-buttons side="right">
                <button menu-toggle="right" class="button button-icon icon ion-navicon"></button>
            </ion-nav-buttons>
        </ion-nav-bar>

        <ion-nav-view name="site"></ion-nav-view>

    </ion-side-menu-content>

    <ion-side-menu side="left" id="mm-side-menu-left">
        ...
    </ion-side-menu>

    <ion-side-menu side="right" id="mm-side-menu-right" is-enabled="rightSideMenuShown">
        ...
    </ion-side-menu>
</ion-side-menus>

Thank you,
Dani

1 Like

@pxdev I want to do the same thing as you. Have you found a solution?

Tanks

Hello,

we weren’t able to set a different value for each one of them, but we were able to show the right side menu with the back button even with enable-menu-with-back-views=“false”.

Basically, we add the menu button for the right side menu in the template of all the views where we want to show it. In those views we also set rightSideMenuShown=true so the menu is shown (you can see my template above).

This is the exact patch:

I hope it helps you!