November Happy Hour will be moved to Thursday December 5th.

Class PageType

Read and save page type information

Inheritance
System.Object
PageType
Implements
System.IComparable
System.IComparable<ContentType>
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public class PageType : ContentType, IComparable, IComparable<ContentType>, IReadOnly<PageType>, IReadOnly

Constructors

PageType()

Initializes a new instance of the PageTypeDefault class.

Declaration
public PageType()

PageType(Int32, Guid, String, String, String, Boolean, Int32)

Initializes a new instance of the PageType class.

Declaration
public PageType(int id, Guid guid, string name, string description, string fileName, bool isAvailable, int sortOrder)
Parameters
Type Name Description
System.Int32 id

The id.

System.Guid guid

The GUID based identifier

System.String name

The name.

System.String description

The description.

System.String fileName

Name of the file.

System.Boolean isAvailable

if set to true [is available].

System.Int32 sortOrder

The sort order.

Properties

Declaration
[Obsolete("Use Defaults.ArchivePageLink instead.", false)]
public PageReference DefaultArchivePageLink { get; set; }
Property Value
Type Description
PageReference

DefaultChildOrderRule

Declaration
[Obsolete("Use Defaults.VisibleInMenu instead.", false)]
public FilterSortOrder DefaultChildOrderRule { get; set; }
Property Value
Type Description
FilterSortOrder

DefaultFrameID

Declaration
[Obsolete("Use Defaults.DefaultFrame.ID instead.", false)]
public int DefaultFrameID { get; set; }
Property Value
Type Description
System.Int32

DefaultPageName

Declaration
[Obsolete("Use Defaults.DefaultPageName instead.", false)]
public string DefaultPageName { get; set; }
Property Value
Type Description
System.String

DefaultPeerOrder

Declaration
[Obsolete("Use Defaults.VisibleInMenu instead.", false)]
public int DefaultPeerOrder { get; set; }
Property Value
Type Description
System.Int32

Defaults

Gets or sets the default values for meta data

Declaration
public PageTypeDefault Defaults { get; set; }
Property Value
Type Description
PageTypeDefault

DefaultStartPublishOffset

Declaration
[Obsolete("Use Defaults.StartPublishOffset instead.", false)]
public TimeSpan DefaultStartPublishOffset { get; set; }
Property Value
Type Description
System.TimeSpan

DefaultStopPublishOffset

Declaration
[Obsolete("Use Defaults.StopPublishOffset instead.", false)]
public TimeSpan DefaultStopPublishOffset { get; set; }
Property Value
Type Description
System.TimeSpan

DefaultVisibleInMenu

Declaration
[Obsolete("Use Defaults.VisibleInMenu instead.", false)]
public bool DefaultVisibleInMenu { get; set; }
Property Value
Type Description
System.Boolean

Definitions

Gets the content definitions for this content type.

Declaration
[Obsolete("Use EPiServer.DataAbstraction.ContentType.PropertyDefinitions instead", false)]
public PageDefinitionCollection Definitions { get; }
Property Value
Type Description
PageDefinitionCollection
See Also

ExportableFileName

Gets the filename in an exportable format which is a application relative path "~"

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

The name of the exportable file.

FileName

RootRelative url to the actual template file (i.e. something starting with "/"). If the backing path from the database is relative (i.e. not starting with "/"), it will be interpreted as relative to the (possibly relocated) UI-folder before being returned as a root-relative path. If the name begins with a magic placeholder (i.e. {EPsUploadDir} or {EPsRootDir}) it is returned unchanged. If the path has not been set null is returned.

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

HasDefaultValues

Declaration
[Obsolete("Use Defaults.HasValues instead.", false)]
public bool HasDefaultValues { get; }
Property Value
Type Description
System.Boolean

HasTemplate

Gets a value indicating whether this page type has a template.

Declaration
[Obsolete("Use extension method content.HasTemplate() instead or access the TemplateModelRepository service")]
public bool HasTemplate { get; }
Property Value
Type Description
System.Boolean

true if this page type has a template; otherwise, false.

Methods

ClearCache()

Clear both the page type cache as well as the DataFactory and IPermanentLinkMapper cache.

Declaration
[Obsolete("The PageType cache management is now a responsibility of the PageTypeRepository implementation.")]
public static void ClearCache()
Remarks

This needs to be called when changing page types that are in use for pages on the site.

See Also

ClearLocalCache()

Clears the local page type cache only.

Declaration
[Obsolete("The PageType cache management is now a responsibility of the PageTypeRepository implementation.")]
public static void ClearLocalCache()
See Also

ClearPageTypeCache()

Clears the page type cache.

Declaration
[Obsolete("The PageType cache management is now a responsibility of the PageTypeRepository implementation.")]
public static void ClearPageTypeCache()

Copy()

Creates a copy of this instance of PageType.

Declaration
[Obsolete("Use the Copy method on the PageTypeRepository service interface instead.")]
public PageType Copy()
Returns
Type Description
PageType

A new PageType instance that has been saved in the database.

CreateWritableClone()

Declaration
public PageType CreateWritableClone()
Returns
Type Description
PageType

CreateWritableCloneImplementation()

The method called by IReadOnly.CreateWritableClone.

Declaration
protected override object CreateWritableCloneImplementation()
Returns
Type Description
System.Object

A clone of this object that is writable.

Overrides
Remarks

This method is called by CreateWritableClone(). If you are inheriting, directly or indirectly, from ContentType you should override this method to make sure that all reference type members of your class are cloned.

Your override of this method must create the clone by calling base.CreateWritableCloneImplementation(). This ensures that all classes in the inheritance chain can create clones as necessary. Also, by calling the base implementation the values of all value type members are copied as ContentType's implementation of this method calls System.Object.MemberwiseClone().

Delete()

Delete page type

Declaration
[Obsolete("Use the Delete method on the PageTypeRepository service interface instead.")]
public void Delete()

FileNameForSite(SiteDefinition)

Get the absolute path for the web form template path.

Declaration
public string FileNameForSite(SiteDefinition siteDef)
Parameters
Type Name Description
SiteDefinition siteDef

Site settings

Returns
Type Description
System.String

The absolute path for the file

List()

List all page types

Declaration
[Obsolete("Use the List method on the PageTypeRepository service interface instead.")]
public static PageTypeCollection List()
Returns
Type Description
PageTypeCollection

A collection of page type objects

Load(Guid)

Load a page type based on globally unique identifier

Declaration
[Obsolete("Use the Load method on the PageTypeRepository service interface instead.")]
public static PageType Load(Guid guid)
Parameters
Type Name Description
System.Guid guid

The globally unique identifier

Returns
Type Description
PageType

A pagetype object or null if not found

Load(Int32)

Load page type based on identifier

Declaration
[Obsolete("Use the Load method on the PageTypeRepository service interface instead.")]
public static PageType Load(int id)
Parameters
Type Name Description
System.Int32 id

The page type identifier

Returns
Type Description
PageType

A pagetype object or null if not found

Load(String)

Load a page type based on its name

Declaration
[Obsolete("Use the Load method on the PageTypeRepository service interface instead.")]
public static PageType Load(string name)
Parameters
Type Name Description
System.String name

The name of the page type

Returns
Type Description
PageType

A pagetype of null if not found

MakeReadOnly()

Makes the current instance and all it's properties read-only.

Declaration
public override void MakeReadOnly()
Overrides
Remarks

After calling this method the IsReadOnly property will return true.

OnPageTypeDeleted(PageTypeEventArgs)

Raises the PageTypeDeleted event.

Declaration
[Obsolete("All PageType events have moved to the PageTypeRepository class.")]
protected virtual void OnPageTypeDeleted(PageTypeEventArgs args)
Parameters
Type Name Description
PageTypeEventArgs args

The PageTypeEventArgs instance containing the event data.

OnPageTypeSaved(PageTypeEventArgs)

Raises the PageTypeSaved event.

Declaration
[Obsolete("All PageType events have moved to the PageTypeRepository class.")]
protected virtual void OnPageTypeSaved(PageTypeEventArgs args)
Parameters
Type Name Description
PageTypeEventArgs args

The PageTypeEventArgs instance containing the event data.

ResetContentType()

Resets data that can be set from model.

Declaration
public override void ResetContentType()
Overrides

Save()

Save changes to page type

Declaration
[Obsolete("Use the Save method on the PageTypeRepository service interface instead.")]
public void Save()

Events

PageTypeDeleted

Occurs when a page type has been deleted.

Declaration
[Obsolete("All PageType events have moved to the PageTypeRepository class.")]
public static event EventHandler<PageTypeEventArgs> PageTypeDeleted
Event Type
Type Description
System.EventHandler<PageTypeEventArgs>

PageTypeSaved

Occurs when a page type has been saved, e.g. created or updated.

Declaration
[Obsolete("All PageType events have moved to the PageTypeRepository class.")]
public static event EventHandler<PageTypeEventArgs> PageTypeSaved
Event Type
Type Description
System.EventHandler<PageTypeEventArgs>

Implements

System.IComparable
System.IComparable<T>

Extension Methods