Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Class PageSiteMapProvider

SiteMap provider for the EPiServer page structure

Inheritance
System.Object
PageSiteMapProvider
Namespace: EPiServer
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class PageSiteMapProvider : SiteMapProvider

Constructors

PageSiteMapProvider()

Declaration
public PageSiteMapProvider()

PageSiteMapProvider(IPageSource)

Declaration
public PageSiteMapProvider(IPageSource pageSource)
Parameters
Type Name Description
IPageSource pageSource

Properties

PageSource

Gets the IPageSource used for accessing pages in the provider instance. When deriving from this class you can override this property to provide a different PageSource. The default PageSource used is the DataFactory Instance.

Declaration
public virtual IPageSource PageSource { get; }
Property Value
Type Description
IPageSource

The IPageSource implementation.

Gets the PageReference representing the root page in the site map.

Declaration
public PageReference StartPageLink { get; }
Property Value
Type Description
PageReference

The start page link.

Methods

FindSiteMapNode(String)

Retrieves a PageSiteMapNode object that represents the page at the specified URL.

Declaration
public override SiteMapNode FindSiteMapNode(string rawUrl)
Parameters
Type Name Description
System.String rawUrl

A URL that identifies the page for which to retrieve a PageSiteMapNode.

Returns
Type Description
System.Web.SiteMapNode

A System.Web.SiteMapNode that represents the page identified by rawURL; otherwise, null, if no corresponding System.Web.SiteMapNode is found or if security trimming is enabled and the System.Web.SiteMapNode cannot be returned for the current user.

FindSiteMapNode(HttpContext)

Finds the site map node based on the state of the current request provided by the http context.

Declaration
public override SiteMapNode FindSiteMapNode(HttpContext ctx)
Parameters
Type Name Description
System.Web.HttpContext ctx

The HttpContext.

Returns
Type Description
System.Web.SiteMapNode

A System.Web.SiteMapNode

FindSiteMapNodeFromKey(String)

Retrieves a PageSiteMapNode object based on a specified key.

Declaration
public override SiteMapNode FindSiteMapNodeFromKey(string key)
Parameters
Type Name Description
System.String key

A lookup key with which a PageSiteMapNode is created.

Returns
Type Description
System.Web.SiteMapNode

A PageSiteMapNode that represents the page identified by key; otherwise, null, if no corresponding System.Web.SiteMapNode is found or if security trimming is enabled and the System.Web.SiteMapNode cannot be returned for the current user. The default is null.

GetChildNodes(SiteMapNode)

Retrieves the child nodes of a specific PageSiteMapNode.

Declaration
public override SiteMapNodeCollection GetChildNodes(SiteMapNode node)
Parameters
Type Name Description
System.Web.SiteMapNode node

The PageSiteMapNode for which to retrieve all child nodes.

Returns
Type Description
System.Web.SiteMapNodeCollection

A read-only System.Web.SiteMapNodeCollection that contains the immediate child nodes of the specified System.Web.SiteMapNode; otherwise, null or an empty collection, if no child nodes exist.

GetPageFromSiteMapNode(SiteMapNode)

Retrieves a PageData instance representing the page of the specified PageSiteMapNode.

Declaration
protected virtual PageData GetPageFromSiteMapNode(SiteMapNode node)
Parameters
Type Name Description
System.Web.SiteMapNode node

The PageSiteMapNode for which a page should be retrieved.

Returns
Type Description
PageData

A PageData instance representing the current page.

GetParentNode(SiteMapNode)

Retrieves the parent node of a specific PageSiteMapNode object.

Declaration
public override SiteMapNode GetParentNode(SiteMapNode node)
Parameters
Type Name Description
System.Web.SiteMapNode node

The PageSiteMapNode for which to retrieve the parent node.

Returns
Type Description
System.Web.SiteMapNode

A PageSiteMapNode that represents the parent of node; otherwise, null, if the PageSiteMapNode has no parent or security trimming is enabled and the parent node is not accessible to the current user.

GetParentPageFromSiteMapNode(SiteMapNode)

Retrieves a PageData instance representing the parent page of the specified PageSiteMapNode.

Declaration
protected virtual PageData GetParentPageFromSiteMapNode(SiteMapNode node)
Parameters
Type Name Description
System.Web.SiteMapNode node

The PageSiteMapNode for which the parent page should be retrieved.

Returns
Type Description
PageData

A PageData instance representing the parent page.

GetProviderFromPage(PageData)

Gets the System.Web.SiteMapProvider that serves the path represented by a specific PageData instance.

Declaration
protected virtual SiteMapProvider GetProviderFromPage(PageData pageData)
Parameters
Type Name Description
PageData pageData

The PageData instance.

Returns
Type Description
System.Web.SiteMapProvider

The System.Web.SiteMapProvider

GetRootNodeCore()

Retrieves the root node of all the nodes that are currently managed by the current provider.

Declaration
protected override SiteMapNode GetRootNodeCore()
Returns
Type Description
System.Web.SiteMapNode

A PageSiteMapNode that represents the root node of the set of nodes that the current provider manages.

GetSiteMapNodeFromPage(PageData, PageData)

Creates a PageSiteMapNode for the provided page represented by a PageData instance and its parent.

Declaration
protected virtual SiteMapNode GetSiteMapNodeFromPage(PageData pd, PageData parent)
Parameters
Type Name Description
PageData pd

A PageData representing the page to create a node for.

PageData parent

A PageData representing the parent page in the hierarchy.

Returns
Type Description
System.Web.SiteMapNode

GetSiteMapNodeFromPage(PageReference)

Gets a System.Web.SiteMapNode for a specific PageReference instance.

Declaration
protected virtual SiteMapNode GetSiteMapNodeFromPage(PageReference pageLink)
Parameters
Type Name Description
PageReference pageLink

The page link to get a sitemap node for

Returns
Type Description
System.Web.SiteMapNode

Initialize(String, NameValueCollection)

Initializes the System.Web.SiteMapProvider implementation, including any resources that are needed to load site map data from persistent storage.

Declaration
public override void Initialize(string name, NameValueCollection attributes)
Parameters
Type Name Description
System.String name

The System.Configuration.Provider.ProviderBase.Name of the provider to initialize.

System.Collections.Specialized.NameValueCollection attributes

A System.Collections.Specialized.NameValueCollection that can contain additional attributes to help initialize the provider. These attributes are read from the site map provider configuration in the Web.config file.

Remarks

The attributes argument accepts the following entries

IsAccessibleToUser(HttpContext, SiteMapNode)

Retrieves a Boolean value indicating whether the specified PageSiteMapNode object can be viewed by the user in the specified context.

Declaration
public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
Parameters
Type Name Description
System.Web.HttpContext context

The System.Web.HttpContext that contains user information.

System.Web.SiteMapNode node

The PageSiteMapNode that is requested by the user.

Returns
Type Description
System.Boolean

true if security trimming is enabled and node can be viewed by the user or security trimming is not enabled; otherwise, false.

Exceptions
Type Condition
System.ArgumentNullException

context is null.- or -node is null.

Extension Methods