allow hidden pages to be included in SiteMap
This commit is contained in:
parent
09b8087787
commit
3b8dc98226
@ -46,13 +46,16 @@ namespace Oqtane.Pages
|
||||
{
|
||||
var sitemap = new List<Sitemap>();
|
||||
|
||||
// internal pages which should not be indexed
|
||||
string[] internalPaths = { "login", "register", "reset", "404" };
|
||||
|
||||
// build site map
|
||||
var rooturl = _alias.Protocol + (string.IsNullOrEmpty(_alias.Path) ? _alias.Name : _alias.Name.Substring(0, _alias.Name.IndexOf("/")));
|
||||
var moduleDefinitions = _moduleDefinitions.GetModuleDefinitions(_alias.SiteId).ToList();
|
||||
var pageModules = _pageModules.GetPageModules(_alias.SiteId);
|
||||
foreach (var page in _pages.GetPages(_alias.SiteId))
|
||||
{
|
||||
if (_userPermissions.IsAuthorized(null, PermissionNames.View, page.PermissionList) && page.IsNavigation)
|
||||
if (_userPermissions.IsAuthorized(null, PermissionNames.View, page.PermissionList) && !internalPaths.Contains(page.Path))
|
||||
{
|
||||
var pageurl = rooturl;
|
||||
if (string.IsNullOrEmpty(page.Url))
|
||||
|
Reference in New Issue
Block a user