Class SiteDefinitionResolverExtensions
Extends ISiteDefinitionResolver with convenient methods
Inheritance
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public static class SiteDefinitionResolverExtensions : Object
Methods
GetByContent(ISiteDefinitionResolver, ContentReference, Boolean, Boolean)
Gets the SiteDefinition for a content reference.
Declaration
public static SiteDefinition GetByContent(this ISiteDefinitionResolver siteDefinitionResolver, ContentReference contentLink, bool fallbackToWildcard, bool fallbackToEmpty)
Parameters
Type | Name | Description |
---|---|---|
ISiteDefinitionResolver | siteDefinitionResolver | The site definition resolver that is being extended |
ContentReference | contentLink | The content link. |
System.Boolean | fallbackToWildcard | if set to |
System.Boolean | fallbackToEmpty | if set to |
Returns
Type | Description |
---|---|
SiteDefinition | A SiteDefinition instance for the site that |
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. If the contentLink
is not located beneath a start page,
and if not fallen back to wildcard and fallbackToEmpty
is set to true then the system default setting will be returned which
has for example RootPage set but not site specific settings like StartPage and SiteUrl.
GetByHostname(ISiteDefinitionResolver, String, Boolean)
Gets the SiteDefinition that has a host that matches specified hostname.
Declaration
public static SiteDefinition GetByHostname(this ISiteDefinitionResolver siteDefinitionResolver, string hostname, bool fallbackToWildcard)
Parameters
Type | Name | Description |
---|---|---|
ISiteDefinitionResolver | siteDefinitionResolver | The site definition resolver that is being extended |
System.String | hostname | Name of the host. |
System.Boolean | fallbackToWildcard | if set to |
Returns
Type | Description |
---|---|
SiteDefinition |