Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Secure Page Indicator In Menu View modes: 
User avatar
Member
Member
kyancey-pbsworksforme - 2/4/2010 3:02:31 PM
   
Secure Page Indicator In Menu
I'm working on a new website for our company that is based on Kentico CMS 4.0 (I haven't upgraded to 5.0 yet). Our site includes many pages that are accessible to anonymous users, but also many pages that are only available to contracted agents who are logged in. Our site has a drop down menu at the top, and most pages also have a tree menu on the left of the page for the current section of the site they are viewing.

So that users will know what pages they can access as a public user, I'd like some kind of visual indicator on the secured webpages. Otherwise, the user may click on the the item in the menu, get blocked by a login page, try another page getting the same result, and get frustrated and leave the site. I don't want to hide the menu items, however, for two reasons:
1. I want to show prospective agents the resources we have available for those who contract with us.
2. I want a contracted agent to be able to select the page they want without first logging in. They'll just get prompted to log in before the website will display that page.

So, essentially, I want to visually differentiate all menu items for pages that require authentication, either by an icon or perhaps a differently styled menu item, if the user isn't authenticated. However, I haven't found any facility for this in the built-in menu controls, and I don't particularly want to write a new set of menu controls from scratch. Does anyone have any suggestions for how I could implement this?

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 2/9/2010 7:09:31 AM
   
RE:Secure Page Indicator In Menu
Hi,

First option here is to use Custom Tree Node Handler (http://devnet.kentico.com/docs/devguide/treenode_handler.htm) and in OnAfterUpdate event of the document you can check if the current document has some secuirity rescrictions and according this information, you can specify Menu item left image (DocumentMenuItemLeftImage), Menu item image (DocumentMenuItemImage) or Menu item right image (DocumentMenuItemRightImage) properties according your needs. Surely, “Apply menu design” option needs to be enabled in your navigation web part/control.

Second option is to modify the resulting DataSource of (if you are using) CMS List Menu web part in OnPreRender method, where you can check if the document has some security restrictions (since DocumentID is available in the resulting DataSet) and according this information you can modify some of the DataSource columns (for example DocumentMenuItemRightImage) to your desired values.

Best regards,
Miroslav Remias.