Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Master Page + static Html Text Web part Text visible / invisible for different Roles View modes: 
User avatar
Member
Member
bsatish417-gmail - 6/25/2011 3:06:51 PM
   
Master Page + static Html Text Web part Text visible / invisible for different Roles
Hi,
We have a requirement to show different Text to different Users who log in to the portal
in the master page , based on there role

For some roles we should not show any text .

I have noticed that on the root site, currentuser webpart is used , which is visible only when user is authenticated & even we can set it to visible for some roles.

But the same options like visible only when user is authenticated & only for some roles in there for static Html Text WebPart

How can i achieve this ?

by the way , this static html text will contain an anchor tag with onclick href = dhtmlxwindow popup with a page which shows dhtmlxtree

so the above popup anchor tag is placed in statichtml webpart & it should be visible only for users with certain roles.

Thanks,
Satish

User avatar
Member
Member
kentico_michal - 6/26/2011 12:10:30 AM
   
RE:Master Page + static Html Text Web part Text visible / invisible for different Roles
Hello Satish,

All Kentico CMS web part provide property called Display to roles that allows you to specify the list of roles who should see the web part. If no role is specified, the web part is displayed to all roles. So, you could add as many Static HTML web parts you need and set the Display to roles property for each od these web part to different role.

Best regards,
Michal Legen

User avatar
Member
Member
bsatish417-gmail - 6/27/2011 6:54:06 PM
   
RE:Master Page + static Html Text Web part Text visible / invisible for different Roles
Thanks for the information , But show only when Authenticated Option is not Available for Static Html Text WebPart .

How can i achieve this ?

Thanks,
Satish

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 6/28/2011 12:11:29 AM
   
RE:Master Page + static Html Text Web part Text visible / invisible for different Roles
Hello,

For this you can use a macro on the visibility property of the web part. Here is a sample:

{%cmscontext.currentuser.username|(equals)public|(truevalue)false|(falsevalue)true%}

That means that if the user name of the current user is public, which means the user isn't authenticated, the web part won't be displayed, otherwise the web part will be visible because the macro produces the return value "true".

Best regards,
Boris Pocatko