version 6 (2022-09-01)
An Optimizely addon that helps and adds menu items to the QuickNavigationMenu when logged in on public site, All configurable links to Search & navigation, admin, admin content type, and logout. Even custom links!
**This is the .net 6 version of : https://github.com/LucGosso/Gosso.EPiServerAddOn.QuickNavExtension ** <-- use this for CMS 11
Available on nuget.optimizely.com https://nuget.optimizely.com/package/?id=Epicweb.Optimizely.QuickNavExtension
This can be installed via the package manager console in Visual Studio.
Run install-package Epicweb.Optimizely.QuickNavExtension
in package manager console.
Default menus are Admin and logout, to activate other menu items apply this appsettings.json: (they are sortable)
"Epicweb.QuickNav": "find,admin,contenttype,logout"
You can add custom menu items, Name and url with pipe in between. Name can be resource path eg /shell/admin/logout
"Epicweb.QuickNav": "Custom link|https://devblog.gosso.se,Custom Javascript|javascript:alert('Hey you'),find,admin,contenttype,logout"
To only show logout item, apply this appsettings:
"Epicweb.QuickNav": "logout"
Alternate way to register links:
Startup.cs
using Epicweb.Optimizely.QuickNavExtension;
//add links in a simple way in startup.
services
.AddQuickNav("Custom link", "https://devblog.gosso.se/", role: "WebDevs")
.AddQuickNav("Custom Javascript", "javascript:if(confirm(\'R U SURE?\')){document.location=\'/\';}", role: "WebDevs")
.AddQuickNav(QuickNavigator.FIND)
.AddQuickNav(QuickNavigator.Admin)
.AddQuickNav(QuickNavigator.ContentType)
.AddQuickNav(QuickNavigator.LogOut);
Role Base Links
You can add a third pipe with rolename from Epi.
eg: “Link title|/urlForDevsOnly/|WebDevs”
<= only WebDevs will see the menu
or “logout||WebEditors”
<= only WebEditors will see the logout menu
Get this solution runing
-
Clone it
-
Unpack the /alloy/app_data/blobs-and-database.zip
-
dotnet run
-
log in to CMS with "admin" and "Test1234!"