hide user list from sliding menu

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
3/23/2017 3:05:51 AM
Gravatar
Total Posts 122

hide user list from sliding menu

Hi Joe

I've upgraded to mojo 2.5, but I have a knowledge with previous skins.. not with new bootstrap one

My only URGENT question is: using skin framework 3.3.7, all users (simple autenticated users) have the sliding-in menu showing, before exit entry, the user list entry...

But how (or where) can I hide the user list entry so it will not appear ? because client do not want that users knows each other

Thank you so much in advance

Michele (from Rome)

3/23/2017 9:20:58 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: hide user list from sliding menu

If I understand your question correctly, I think you can go to Administration > Permissions > change the permissions for "Roles that can view the member list page" to remove Authenticated Users. Once you have done that, it will only be visible to Admins (or whatever roles you choose).

3/23/2017 9:33:19 AM
Gravatar
Total Posts 216
Community Expert

mojoPortal Hosting & Design @ i7MEDIA!

Re: hide user list from sliding menu

Hi Michele,

In all Framework based skins you will find a folder called "includes". Immediately inside this folder is a file called "administration-drawer.html", which is added to the layout.Master with an #include tag.

There are a few options for getting the results you're after, one is to restrict the view of the admin bar to certain roles. To do this you can wrap all the markup in that .html file with something like this:

<% if (WebUser.IsInRoles("Admins,Adminbar Enabled Role")) {%> 
    <!-- Admin bar code here -->  
<% }

The "IsInRoles" method accepts a comma-separated list of role names. There are a few script tags at the bottom of the file which already use this method to restrict the rendering of a variable that is passed to a JS script in the skin based on role, this variable only controls the initial visibility of the admin bar though. If you take this approach I recommend you simply move the <% if () {}%> statement from line 73 up to line 1 and then adjust the roles you'd like the bar to be visible to.

Another approach to this would be to wrap just the member list link with this role-check code, which would look something like this:

<% if (WebUser.IsInRoles("Admins,Memberlist Enabled Role")) {%> 
    <li><portal:MemberListLink  runat="server" /></li>
<% } %>

Note: The MemberListLink is on line 58 of the administration-drawer.html file in framework unless you've already edited the file.

I hope this helps!

3/23/2017 9:40:30 AM
Gravatar
Total Posts 216
Community Expert

mojoPortal Hosting & Design @ i7MEDIA!

Re: hide user list from sliding menu

Hey Crispin,

That is a good suggestion but one downside of that approach is that you'll be left with an empty <li></li> in the bar still because of the way the markup is written directly into the markup instead of rendered with the control. I'll look into fixing this to make it it easier to control that kind of thing in future releases of Framework.

Thanks!

3/23/2017 9:46:19 AM
Gravatar
Total Posts 2253

Re: hide user list from sliding menu

Great discussion!

I think both methods should be used. If you're worried about users seeing the membership list at all, the permissions should be set properly, as Crispin suggested, to prevent someone from manually entering the URL for it. Isaac's suggestion should be used in conjunction so the empty LI isn't shown, at least until we change Framework to not show the LI when the link isn't enabled.

Thanks,
Joe

3/23/2017 11:07:09 AM
Gravatar
Total Posts 216
Community Expert

mojoPortal Hosting & Design @ i7MEDIA!

Re: hide user list from sliding menu

Michele,

I did some poking around and found that the MemberListLink control allows us to use "RenderAsListItem" to create the <li> programmatically. This means you can just change the <li><portal:MemberListLink runat="server" /></li> markup on line 58 to <portal:MemberListLink  runat="server" RenderAsListItem="true" ListItemCss="any-class" CssClass="any-class" />, (removing the li entirely) and then change the roles that can view the memberlist as Crispin suggested. This will ensure no empty list items are rendered.

We'll look into adding this change to Framework by default so that it responds appropriately to the role permissions.

Thanks!
Isaac

3/24/2017 10:43:26 AM
Gravatar
Total Posts 122

Re: hide user list from sliding menu

Hi all.. thank you for useful tips.. you are great!

just on other segnalation

When a site has all pages flagged as to not be shown in menu, if you look at it with mobile devices the hamburger is always shown, even if there are no menu item to display 

it s a minor thing.. but mojo is great so why not should be perfect ?

 

best regards...

michele from Rome 

3/24/2017 12:22:54 PM
Gravatar
Total Posts 2253

Re: hide user list from sliding menu

Hi Michele,

Are you talking about the admin drawer on the left or the site menu?

Thanks,
Joe

You must sign in to post in the forums. This thread is closed to new posts.