Hello,
Is it possible to hide navbar for a particular user in the SuiteCRM 7.x?
Thanks in advance!
Hello,
Is it possible to hide navbar for a particular user in the SuiteCRM 7.x?
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.
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
Do we have to do repair / rebuild JS files?
Edit: I did QR&R
I tried it on v7.x and it is working.
But, how can I minimize the navbar for the particular user?
Is there way to add that in code?
I think, we can use a global variable in style.js at the top. In your custom/themes/SuiteP/js/style.js file, add the following at the top
var currentUserName;
Set the value to this variable in PHP code using global $currentUse
r and add another condition in JS code(on mouse hover) to remove the css to hide the navbar.
can you please try this if this helps.
But I think this will hide navbar for all users.
I just want to hide the navbar for the user XYZ only.
So, if user XYZ logged in, then his navbar should be hidden until he move cursor to the top side of window.