Foren

Make a element only be visible for admins.

thumbnail
lutz Bremen, geändert vor 11 Jahren.

Make a element only be visible for admins.

Expert Beiträge: 291 Beitrittsdatum: 20.10.11 Neueste Beiträge
hey guys,

i basicly hid an element for normal users and set in css "display:none".

now i want to add some code to the theme that makes that attribute visible only for admins. so i wanna know how to realise this?

first i want to check if the user is an admin so i found this code:
#set($adminView='')
#if ( ($is_signed_in) && ( ($permissionChecker.isOmniadmin())||($permissionChecker.isCompanyAdmin($themeDisplay.getCompanyId())) ) )
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    #set($adminView='adminview')
#end


where i set the xxxxxx there must be the overiding for the css. in the css of the portlet its called :
.lfr-contact-extra {
display:none;
}


so what should i write now? i thought of .s.th. like this
<class="lfr-contact-extra" style="display:block" />
thumbnail
Jorn De Prins, geändert vor 11 Jahren.

RE: Make a element only be visible for admins.

New Member Beiträge: 3 Beitrittsdatum: 20.01.12 Neueste Beiträge
You don't need to hide this with css. You just have to do a check to determine if the logged in user is an admin, If that isn't the case the scriptcode between '#if 'and '#end' won't be executed