Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
whats the best way to render a role based navigation?
There is a function Umbraco.MemberHasAccess(string path) that should handle this.
foreach (var node in Model.Content.Children)
//member has access, generate menu here
But this function slows down the rendering as it does lots of duplicate roundtrips.
Thx in advance,
I'd look in to Donut caching, where you 'vary by custom string' such that the string represents the User's role or Id.
Alternatively, just create a decent view model for all the site pages that might be rendered and cache that model. The don't worry about the view running each time as it should be relatively fast. I don't think Umbraco.MemberHasAccess will hit the database.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted