Hide navbar for a particular user

Hello,

Is it possible to hide navbar for a particular user in the SuiteCRM 7.x? :face_with_peeking_eye: :upside_down_face: :thinking:

Thanks in advance!

Hey @rsp ,

We can create a new role with all the modules disabled and assign this role to the user to hide the modules (not sure if the navigation bar is displayed when logs in)

Could you please help understand how the user would access the modules. Would he enter the module and view name in the address bar to work with a particular module. Thank you!

I saw that we could hide modules under user’s profile settings. I just want to display one module for that user.

I think I need to find how to hide that navbar and when someone hover to top side then it will be displayed.

I need to verify, if it is possible with the CSS code.

1 Like

This could be possible solution but I don’t know where to insert the JS code:

CSS:

.navbar-fixed-top {
    transition: top 0.3s ease;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; 
}

.navbar-hidden {
    top: -60px; 
}

JavaScript:

$(document).ready(function() {
    var navbar = $('.navbar-fixed-top');

    // Initially hide the navbar
    navbar.addClass('navbar-hidden');

    // Show navbar on mouse hover near the top
    $(document).on('mousemove', function(e) {
        if (e.clientY < 50) { // Adjust this value for the hover area
            navbar.removeClass('navbar-hidden');

            // Set a timeout to hide the navbar after 2 seconds
            clearTimeout($.data(this, 'hideTimer'));
            $.data(this, 'hideTimer', setTimeout(function() {
                navbar.addClass('navbar-hidden');
            }, 2000)); // Adjust the duration as needed
        }
    });
});

I have some css and javascript code in custom\themes\SuiteP\css\Dawn\style.css and custom\themes\SuiteP\js\style.js (without script tag) files respectively. This works in v7. Please can you try. Thanks

1 Like

Do we have to do repair / rebuild JS files? :thinking:

Edit: I did QR&R

I tried it on v7.x and it is working. :+1:

1 Like