Try our conversational search powered by Generative AI!

Class SiteDefinition

Holds settings for a site specific definitions like roots for files, blocks etc.

Inheritance
System.Object
SiteDefinition
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: 7.19.2
Syntax
[EPiServerDataTable(TableName = "tblSystemBigTable")]
public class SiteDefinition : IReadOnly<SiteDefinition>, IReadOnly

Constructors

SiteDefinition()

Declaration
public SiteDefinition()

Fields

SiteAssetsName

Get the name for the site specific assets folder

Declaration
public const string SiteAssetsName = "SysSiteAssets"
Field Value
Type Description
System.String

WildcardHostName

The wild card host name that is used to map unmapped hosts.

Declaration
public const string WildcardHostName = "*"
Field Value
Type Description
System.String

Properties

ContentAssetsRoot

Gets the reference for the root that holds content related assets.

Declaration
public virtual ContentReference ContentAssetsRoot { get; }
Property Value
Type Description
ContentReference

The content assets root.

Current

The instance of SiteDefinition that matches the request. When no site is matched from request or wildcard mapping an empty instance is returned where System can be used to access settings that are not site specific.

Declaration
public static SiteDefinition Current { get; set; }
Property Value
Type Description
SiteDefinition
Remarks

During runtime it will get SiteDefinitionResolver from IOC container and load settings for current site. If respoitory is not found in container (for example when executed in unit tests) the value will be an SiteDefinition instance with all roots set to EmptyReference

Empty

Gets an empty defintion wich can be used to access System settings.

Declaration
public static SiteDefinition Empty { get; }
Property Value
Type Description
SiteDefinition
Remarks

This is a singleton instance which can be compared against using object comparison.

GlobalAssetsRoot

Gets the reference for the global assets root.

Declaration
public virtual ContentReference GlobalAssetsRoot { get; }
Property Value
Type Description
ContentReference

The global assets root.

Hosts

Gets or sets the hosts.

Declaration
public virtual IList<HostDefinition> Hosts { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<HostDefinition>

The hosts.

Id

Gets or sets the id.

Declaration
public virtual Guid Id { get; set; }
Property Value
Type Description
System.Guid

The id.

IsReadOnly

Gets a value indicating whether this instance is read only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean

true if this instance is read only; otherwise, false.

Item[String]

Gets or sets the setting of type System.Object that was registered with the specified key.

Declaration
public virtual object this[string key] { get; set; }
Parameters
Type Name Description
System.String key

The key.

Property Value
Type Description
System.Object

The System.Object.

Remarks

Custom settings should be set during initialization.

Name

Identity of site settings instance

Declaration
public virtual string Name { get; set; }
Property Value
Type Description
System.String

RootPage

Gets the reference for the root page.

Declaration
public virtual ContentReference RootPage { get; }
Property Value
Type Description
ContentReference

The root page.

SiteAssetsRoot

Gets or sets the reference for the site specific assets root.

Declaration
public virtual ContentReference SiteAssetsRoot { get; set; }
Property Value
Type Description
ContentReference

The site assets root.

Remarks

Setting the value to null means the site does not have a specific asset root meaning global asset root is used.

SiteUrl

Gets or sets the site URL.

Declaration
public virtual Uri SiteUrl { get; set; }
Property Value
Type Description
System.Uri

The site URL.

StartPage

Gets or sets the reference for the start page.

Declaration
public virtual ContentReference StartPage { get; set; }
Property Value
Type Description
ContentReference

The start page.

WasteBasket

Gets the reference for the waste basket.

Declaration
public virtual ContentReference WasteBasket { get; }
Property Value
Type Description
ContentReference

The waste basket.

Methods

CreateWritableClone()

Creates the writable clone.

Declaration
public virtual SiteDefinition CreateWritableClone()
Returns
Type Description
SiteDefinition

MakeReadOnly()

Makes the read only.

Declaration
public void MakeReadOnly()

ThrowIfReadOnly()

Throws an exception if the current instance is read-only.

Declaration
protected virtual void ThrowIfReadOnly()

Explicit Interface Implementations

IReadOnly.CreateWritableClone()

Creates the writable clone.

Declaration
object IReadOnly.CreateWritableClone()
Returns
Type Description
System.Object

Implements

Extension Methods