Try our conversational search powered by Generative AI!

Class SiteDefinitionResolver

Resolves which SiteDefinition to use.

Inheritance
System.Object
SiteDefinitionResolver
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
[Obsolete("Use ISiteDefinitionResolver instead")]
public class SiteDefinitionResolver : ISiteDefinitionResolver

Constructors

SiteDefinitionResolver()

Declaration
public SiteDefinitionResolver()

Methods

GetByContent(ContentReference, Boolean)

Gets the SiteDefinition for a content reference.

Declaration
public virtual SiteDefinition GetByContent(ContentReference contentLink, bool fallbackToWildcardMapped)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.Boolean fallbackToWildcardMapped
Returns
Type Description
SiteDefinition

A SiteDefinition instance for the site that contentLink belongs to or null if no site could be matched.

Remarks

This is done by traversing the page tree upwards from current link until a Page that matches a StartPage for a registered SiteDefinition.

If the contentLink is not located beneath a start page, the search will fall back to the SiteDefinition instance for the site mapped with * as host fallbackToWildcard is set to True.

GetByHostname(String, Boolean, out HostDefinition)

Gets the SiteDefinition that has a host that matches specified hostname.

Declaration
public virtual SiteDefinition GetByHostname(string hostName, bool fallbackToWildcard, out HostDefinition matchedHost)
Parameters
Type Name Description
System.String hostName
System.Boolean fallbackToWildcard

if set to true then site matched with wildcard (if any) is returned

HostDefinition matchedHost

The HostDefinition on the site definition that matched the provided host name.

Returns
Type Description
SiteDefinition

The SiteDefinition that matches host or null if no matches

GetDefinitionForContent(ContentReference, Boolean, Boolean)

Declaration
public virtual SiteDefinition GetDefinitionForContent(ContentReference contentLink, bool fallbackToWildcardMapped, bool fallbackToEmpty)
Parameters
Type Name Description
ContentReference contentLink
System.Boolean fallbackToWildcardMapped
System.Boolean fallbackToEmpty
Returns
Type Description
SiteDefinition

Implements

Extension Methods

EPiServer.Web.SiteDefinitionResolverExtensions.GetByHostname(EPiServer.Web.ISiteDefinitionResolver, System.String, System.Boolean)
EPiServer.Web.SiteDefinitionResolverExtensions.GetByContent(EPiServer.Web.ISiteDefinitionResolver, EPiServer.Core.ContentReference, System.Boolean, System.Boolean)