Reputation: 710
I am trying to setup a website in Orchard CMS it has a menu with items. I do not want to show certain menu items, if the user is not logged in. If the user is logged in he should see more menu items. How can I achieve this Orchard CMS. I don't see any thing that restricts users to certain navivgation items.
Upvotes: 4
Views: 1383
Reputation: 9508
Here is a quick guide using the dashboard:
Go to Navigation. Click Add new menu.... Call it something obvious.
Click Save. Navigation page should reload with menu selected.
Click Add content item. Add your authentication-only page.
Save.
Now head to widgets. Change the Current Layer at the top to 'Authenticated'. Then, in the navigation section click Add to add a widget. Make it a menu widget.
Zone should be 'Navigation'. Layer should be 'Authenticated'. Make the position 2 if you want it to follow on from your current menu. Don't show the menu title. And change the For Menu to be your recently created Authenticated Menu.
Now check your site. You should have extra menu items!
NOTES: This adds an extra menu in addition to the existing one which all users will see, which means your page source will have a new <article>
and <ul>
tags etc. Depending on theme, this may or may not display as you want. If you want a set of items to appear for both anonymous and authenticated, and then have extra items to appear for authenticated users, you can do the above, or recreate the full menu, and show that to an authenticated user. This would mean you would need to move the main menu widget to the Anonymous Layer.
Upvotes: 6