Hide Custom menu for logged in user without hiding theme provided Menu

Hide Custom menu for logged in user without hiding theme provided Menu

by Nishant Pandya -
Number of replies: 3
Hi guys !! I am using Moodle 2.9. I have work on Menu section. I have create some custom Menu from Site administration -> Appearance -> Theme -> Theme Setting. I am using theme Gourmet. Gourmet also provide a Menu i.e. My Dashboard & My Course. My Dashboard & My Course menu display only for logged in user. I want to hide Custom Menu which is created from theme setting for logged-in user without hiding Gourmet provided menu.


d


I have update some code in header.php :

Replace Code :  <?php echo $OUTPUT->custom_menu(); ?>

Replace From : <?php if(isloggedin()) { echo $OUTPUT->custom_menu(); }?>


But after login both Custom Menu as well as Gourmet provided Menu Hidden. Please help me guys how can I hide only custom menu created from Site administration -> Appearance -> Theme -> Theme Setting.


Thanks,

Nishant

Average of ratings: -
In reply to Nishant Pandya

Re: Hide Custom menu for logged in user without hiding theme provided Menu

by Nishant Pandya -

Hi guys !! Please help me. I am not getting any solution yet.

Please help. Thanks.

In reply to Nishant Pandya

Re: Hide Custom menu for logged in user without hiding theme provided Menu

by Nidhi Tiwari -

Hi Nishant,


To achieve this you have to add below condition in theme\bootstrapbase\renderers\core_render.php line no 78 under function render_custom_menu()


if(isloggedin()){
        $custommenuitems='';
        }


Regards,

Nidhi



In reply to Nidhi Tiwari

Re: Hide Custom menu for logged in user without hiding theme provided Menu

by Nishant Pandya -

Hey Nidhi Tiwari. Thanks a lot. Thanks for you helpful answer. You are expert smile

Thanks,

Nishant