I went throught couple of blogs and tutorials, I also bought the videos from umbraco.tv but still I have problems with understanding everything. That's why I need your help.
and now I have login and register page, 2 pages for each of registered users (UserA belongs to GroupA and UserB to GroupB), and some other pages visible for everyone.
The questions is: how to hide links which certain users can't access because they don't belong to certain group?
In my Master template, I have a part of this code:
How Can I display the menu options based on membership? In the finanl effect I want to have a website with login page, after user loggs in, he will see everything what is meant to be there for a certain Member group.
Hide Content/links if not in Member Group
Hi,
I went throught couple of blogs and tutorials, I also bought the videos from umbraco.tv but still I have problems with understanding everything. That's why I need your help.
I went throught this: http://siempresolutions.co.uk/blog/Umbraco_Members_Protected_Area_of_Website
and now I have login and register page, 2 pages for each of registered users (UserA belongs to GroupA and UserB to GroupB), and some other pages visible for everyone.
The questions is: how to hide links which certain users can't access because they don't belong to certain group?
In my Master template, I have a part of this code:
How Can I display the menu options based on membership? In the finanl effect I want to have a website with login page, after user loggs in, he will see everything what is meant to be there for a certain Member group.
This is what I have till now:
@{var homePage = CurrentPage.AncestorsOrSelf(1).First(); var menuItems = homePage.Children.Where("UmbracoNaviHide == false");foreach (var item in menuItems){ var loginAcces = umbraco.library.IsProtected(item.id, item.path) && umbraco.library.HasAccess(item.id, item.path);var cssClass = loginAcces ? "loginAcces ":"";cssClass += CurrentPage.IsDescendantOrSelf(item) ? "currentpageitem" :""; if(!umbraco.library.IsProtected(item.id, item.path) || loginAcces){<li><a href="@item.id">@item.name</a></li>}}}seems to work in 90%.
is working on a reply...