Coloring user name according to level? |
Post Reply |
Author | |
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
Posted: Jan 12 2017 at 8:11pm |
Hi! OE team,
I use Packs #61:'Show User' element: several formants for displaying user name and status. However, I want to color user name according to user level which is set in user-profile-edit. For example, if admin is admin level; level 10, then it would be displayed RED such as admin. or if user1 is customer level; level 1, then it would be displayed BLUE such as user1. How can I apply this feature using OE? I always appreciate your kind and prompt help! DJ
Edited by djju1029 - Jan 13 2017 at 2:25pm |
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(2)
|
Hi,
You can use the Pack 70 (in "[Advanced]" branch), delete all except the field element to the right of "Access rights". This field will display the user's acces right: 1 for basic user, 10 for admin, anything else for advanced. You can hide this field (uncheck the property Visible), add a Custom Class "level". Add a Custom Class "user" onto the element showing the user, then get the level in a Code Block (Source) type JavaScript: $(function(){ var level = parseInt($('.level input').val()); // 1=basic, 10=admin, 4 or 5 = advanced $('.user').addClass('user-color user-color' + level); }); Then add a Code Block Source type CSS position HEader with the code: .user-color { /* default = advanced user */ color: green !important; } .user-color1 { color: blue !important; } /* basic user */ .user-color10 { color: red !important; } /* admin */ If it does not work I will need the link. |
|
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
|
It works! Thank you! You are really my mentor!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |