Class Page
- Namespace
- Dynamicweb.Content
- Assembly
- Dynamicweb.dll
The Page class models the concept of a webpage
public class Page : Entity<int>, IChangeTracking, IPermissionObject, IDisplayName, IPermissionLookup, IPermissionControlled
- Inheritance
-
Page
- Implements
- Inherited Members
- Extension Methods
Constructors
Page()
Private constructor for the sake of supporting xml serialization. :(
public Page()
Page(int)
Initializes a new instance of the Page class with the specified area id indicating to which website this is a part of
public Page(int areaId)
Parameters
areaId
int- The id of the area (website) to which this page belongs
Page(int, int)
Initializes a new instance of the Page class with the provided arguments
public Page(int areaId, int parentPageID)
Parameters
areaId
int- The id of the area (website) to which this page belongs
parentPageID
int- The id of the page that is the parent page of this new instance
Properties
Active
Gets or sets a value indicating whether this Page is active.
Active in this case means "Show in menu" and that the page can be seen in the frontend and should be displayed in navigation.
It is not to be confused with "Hidden" property which means that the page is unpublished.
See ShowInMenu
public bool Active { get; set; }
Property Value
- bool
true
if active; otherwise,false
.
ActiveFrom
Gets or sets the active from.
public DateTime ActiveFrom { get; set; }
Property Value
- DateTime
- The active from.
ActiveTo
Gets or sets the active to.
public DateTime ActiveTo { get; set; }
Property Value
- DateTime
- The active to.
Allowclick
Gets or sets a value indicating whether this Page is clickable in navigations.
public bool Allowclick { get; set; }
Property Value
- bool
true
if allowed; otherwise,false
.
Allowsearch
Gets or sets a value indicating whether this Page is searchable.
public bool Allowsearch { get; set; }
Property Value
- bool
true
if searchable; otherwise,false
.
ApprovalState
Gets or sets the state of the approval.
public int ApprovalState { get; set; }
Property Value
- int
- The state of the approval.
ApprovalStep
Gets or sets the approval step.
public int ApprovalStep { get; set; }
Property Value
- int
- The approval step.
ApprovalType
Gets or sets the type of the approval.
public int ApprovalType { get; set; }
Property Value
- int
- The type of the approval.
Remarks
-2 = Draft, -1 = versions, 0 = normal, >0 = Some workflow
Area
Gets the area.
public Area Area { get; }
Property Value
- Area
- The area.
AreaId
Gets or sets the area ID.
public int AreaId { get; set; }
Property Value
- int
- The area ID.
BackgroundImage
Gets or sets the background image.
[Obsolete("Do not use")]
public string BackgroundImage { get; set; }
Property Value
- string
- The background image.
CacheFrequence
Gets or sets the cache frequence.
[Obsolete("Do not use")]
public int CacheFrequence { get; set; }
Property Value
- int
- The cache frequence.
CacheMode
Gets or sets the cache mode.
[Obsolete("Do not use")]
public int CacheMode { get; set; }
Property Value
- int
- The cache mode.
ContentType
Gets or sets the content type.
public string ContentType { get; set; }
Property Value
CopyOf
Gets or sets the id of the page for which this is a copy of
public int CopyOf { get; set; }
Property Value
- int
- a value indicating the id of the page for which this is a copy
CreationRules
Gets or sets collection of creation rules metadata collection.
public CreationRuleMetadataCollection CreationRules { get; set; }
Property Value
Description
Gets or sets the description.
public string Description { get; set; }
Property Value
- string
- The description.
DisplayMode
Gets or sets the page display mode.
public DisplayMode DisplayMode { get; set; }
Property Value
ExactUrl
Gets or sets the exact URL for page.
public string ExactUrl { get; set; }
Property Value
- string
- The page exact URL.
FooterImage
Gets or sets the footer image.
[Obsolete("Do not use")]
public string FooterImage { get; set; }
Property Value
- string
- The footer image.
ForIntegration
public bool ForIntegration { get; set; }
Property Value
HasExperiment
Gets or sets a value indicating whether this page has aexperiment associated with it.
public bool HasExperiment { get; set; }
Property Value
- bool
true
if this instance has an experiment; otherwise,false
.
Hidden
Gets or sets a value indicating whether this Page is hidden.
Hidden in this case means "Inactive" and that the page cannot be seen in the frontend.
It is not to be confused with "Hidden in menu" which is handled by the Active property
public bool Hidden { get; set; }
Property Value
- bool
true
if hidden; otherwise,false
.
HideForDesktops
Gets or sets a value indicating whether this page should be hidden for desktops in navigation - that is devices not detected as phone or tablet.
public bool HideForDesktops { get; set; }
Property Value
- bool
true
if hide for desktops; otherwise,false
.
HideForPhones
Gets or sets a value indicating whether this page should be hidden for phones in navigation.
public bool HideForPhones { get; set; }
Property Value
- bool
true
if hide for phones; otherwise,false
.
HideForTablets
Gets or sets a value indicating whether this page should be hidden for tablets in navigation.
public bool HideForTablets { get; set; }
Property Value
- bool
true
if hide for tablets; otherwise,false
.
ImageActivePage
Gets or sets the image active page.
[Obsolete("Do not use")]
public string ImageActivePage { get; set; }
Property Value
- string
- The image active page.
ImageMouseOut
Gets or sets the image mouse out.
[Obsolete("Do not use")]
public string ImageMouseOut { get; set; }
Property Value
- string
- The image mouse out.
ImageMouseOver
Gets or sets the image mouse over.
[Obsolete("Do not use")]
public string ImageMouseOver { get; set; }
Property Value
- string
- The image mouse over.
IsFolder
Gets or sets a value indicating whether this page is a folder.
public bool IsFolder { get; set; }
Property Value
- bool
true
if this instance is folder; otherwise,false
.
IsLanguage
Gets a value indicating whether this instance is language.
public bool IsLanguage { get; }
Property Value
- bool
true
if this instance is language; otherwise,false
.
IsMaster
Gets a value indicating whether this instance is master.
public bool IsMaster { get; }
Property Value
- bool
true
if this instance is master; otherwise,false
.
IsSeoOptimized
Gets a value indicating whether this instance is seo optimized.
[Obsolete("Do not use")]
public bool IsSeoOptimized { get; }
Property Value
- bool
true
if this instance is seo optimized; otherwise,false
.
IsTemplate
Gets or sets a value indicating whether this instance is template.
public bool IsTemplate { get; set; }
Property Value
- bool
true
if this instance is template; otherwise,false
.
IsTemplateFolder
Gets a value indicating whether this instance is template folder.
public bool IsTemplateFolder { get; }
Property Value
- bool
true
if this instance is template folder; otherwise,false
.
Item
Gets the associated item.
public Item Item { get; }
Property Value
ItemId
Gets or sets the id of the associated item.
public string ItemId { get; set; }
Property Value
ItemType
Gets or sets the item type associated with the given page.
public string ItemType { get; set; }
Property Value
Keywords
Gets or sets the keywords.
public string Keywords { get; set; }
Property Value
- string
- The keywords.
Languages
Gets the language versions of the page.
public PageCollection Languages { get; }
Property Value
- PageCollection
- The languages. Returns
(Nothing in Visual Basic) if the page is not a master.null
Layout
Gets the layout.
public Layout Layout { get; }
Property Value
- Layout
- The layout.
LayoutApplyToSubPages
Gets or sets a value indicating whether layout template applies to sub pages.
public bool LayoutApplyToSubPages { get; set; }
Property Value
- bool
true
if layout applies to sub pages; otherwise,false
.
LayoutPhoneTemplate
Gets or sets the layout phone template.
public string LayoutPhoneTemplate { get; set; }
Property Value
- string
- The layout template.
LayoutTabletTemplate
Gets or sets the layout tablet template.
public string LayoutTabletTemplate { get; set; }
Property Value
- string
- The layout template.
LayoutTemplate
Gets or sets the layout template.
public string LayoutTemplate { get; set; }
Property Value
- string
- The layout template.
Level
public int Level { get; }
Property Value
ManageFrequence
Gets or sets the manage frequence.
[Obsolete("Do not use")]
public int ManageFrequence { get; set; }
Property Value
- int
- The manage frequence.
Manager
Gets or sets the manager.
[Obsolete("Do not use")]
public int Manager { get; set; }
Property Value
- int
- The manager.
MasterPage
Gets the master page when the page is a lanugage.
public Page MasterPage { get; }
Property Value
- Page
- The master page.
MasterPageEditTime
Gets the master page edit time.
public DateTime MasterPageEditTime { get; }
Property Value
- DateTime
- The master page edit time.
MasterPageId
Gets or sets the master page ID.
public int MasterPageId { get; set; }
Property Value
- int
- The master page ID.
MenuLogoImage
Gets or sets the menu logo image.
[Obsolete("Do not use")]
public string MenuLogoImage { get; set; }
Property Value
- string
- The menu logo image.
MenuText
Gets or sets the menu text. This is the name of the page and is used in the navigation.
public string MenuText { get; set; }
Property Value
- string
- The menu text.
MetaCanonical
Gets or sets the page canonical url.
public string MetaCanonical { get; set; }
Property Value
- string
- The canonical url.
MetaTitle
Gets or sets the meta title.
public string MetaTitle { get; set; }
Property Value
- string
- The meta title.
MouseOver
Gets or sets the mouse over.
[Obsolete("Do not use")]
public string MouseOver { get; set; }
Property Value
- string
- The mouse over.
NavigationSettings
Gets or sets the navigation settings.
public PageNavigationSettings NavigationSettings { get; set; }
Property Value
- PageNavigationSettings
- The navigation settings.
NavigationTag
Gets or sets the navigation tag used for referencing navigation by tag instead of ID.
public string NavigationTag { get; set; }
Property Value
- string
- The navigation tag.
Nofollow
If set, will nofollow meta tag to the page: <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
public bool Nofollow { get; set; }
Property Value
- bool
- boolean flag
Noindex
If set, will add noindex meta tag to the page: <META NAME="ROBOTS" CONTENT="NOINDEX">
public bool Noindex { get; set; }
Property Value
- bool
- boolean flag
Parent
Gets or sets the parent.
public Page Parent { get; }
Property Value
- Page
- The parent.
ParentLayoutTemplate
Gets the parent layout template if the parent template is applied to sub pages.
public string ParentLayoutTemplate { get; }
Property Value
- string
- The parent layout template.
ParentPageId
Gets or sets the parent page ID.
public int ParentPageId { get; set; }
Property Value
- int
- The parent page ID.
Password
Gets or sets the password.
public string Password { get; set; }
Property Value
- string
- The password.
Permission
Gets or sets the permission.
public string Permission { get; set; }
Property Value
- string
- The permission.
PermissionTemplate
Gets or sets the permission template.
public string PermissionTemplate { get; set; }
Property Value
- string
- The permission template.
PermissionType
Gets or sets the type of the permission.
public int PermissionType { get; set; }
Property Value
- int
- The type of the permission.
PropertyItem
Gets the associated property item.
public Item PropertyItem { get; }
Property Value
PropertyItemId
Gets or sets the id of the associated property item.
public string PropertyItemId { get; set; }
Property Value
Protect
Gets or sets a value indicating whether this Page is protected with a password.
public bool Protect { get; set; }
Property Value
- bool
true
if protect; otherwise,false
.
Published
Determines whether the page is published taking active period into consideration.
public bool Published { get; }
Property Value
- bool
true
if the page is published and current time is within the active period; otherwise,false
.
Robots404
If set, will return 404 error when known robot tries to request this page
public bool Robots404 { get; set; }
Property Value
- bool
- boolean flag
ShortCut
Gets or sets the short cut.
public string ShortCut { get; set; }
Property Value
- string
- The short cut.
ShortCutRedirect
Gets or sets a value indicating whether [short cut redirect].
public bool ShortCutRedirect { get; set; }
Property Value
- bool
true
if [short cut redirect]; otherwise,false
.
ShowFavorites
Gets or sets a value indicating whether to show in favorites.
[Obsolete("Do not use")]
public bool ShowFavorites { get; set; }
Property Value
- bool
true
if shown in favorites; otherwise,false
.
ShowInLegend
Gets or sets a value indicating whether to show in legend.
public bool ShowInLegend { get; set; }
Property Value
- bool
true
if shown in legend; otherwise,false
.
ShowInMenu
Gets a value indicating if the current page should be hidden in the menu.
Page setting in UI 'Published':
Page.Active = true, Page.Hidden = false
(ShowInMenu = True)
Page setting in UI 'Hide in menu': Page.Active = false, Page.Hidden = false
(ShowInMenu = True)
Page setting in UI 'Unpublished': Page.Active = false, Page.Hidden = true
(ShowInMenu = False)public bool ShowInMenu { get; }
Property Value
ShowInSitemap
Gets or sets a value indicating whether page is showed in sitemap.
public bool ShowInSitemap { get; set; }
Property Value
- bool
true
if shown in sitemap; otherwise,false
.
ShowTopImage
Gets or sets a value indicating whether [show top image].
[Obsolete("Do not use")]
public bool ShowTopImage { get; set; }
Property Value
- bool
true
if [show top image]; otherwise,false
.
ShowUpdateDate
Gets or sets a value indicating whether to show the page update date.
public bool ShowUpdateDate { get; set; }
Property Value
- bool
true
if showing the update date; otherwise,false
.
Sort
Gets or sets the sort.
public int Sort { get; set; }
Property Value
- int
- The sort.
SslMode
Gets or sets a value indicating SSLMode
public int SslMode { get; set; }
Property Value
- int
1
Standard,2
Force SSL,3
Un-force SSL
Stylesheet
Gets or sets the stylesheet.
[Obsolete("Do not use")]
public int Stylesheet { get; set; }
Property Value
- int
- The stylesheet.
TemplateDescription
Gets or sets the template description.
public string TemplateDescription { get; set; }
Property Value
- string
- The template description.
TemplateImage
Gets or sets the template image
public string TemplateImage { get; set; }
Property Value
- string
- The template image.
TextAndImage
Gets or sets a value indicating whether [text and image].
[Obsolete("Do not use")]
public bool TextAndImage { get; set; }
Property Value
- bool
true
if [text and image]; otherwise,false
.
TopImage
Gets or sets the top image.
public string TopImage { get; set; }
Property Value
- string
- The top image.
TopLevelIntegration
public bool TopLevelIntegration { get; set; }
Property Value
TopLogoImage
Gets or sets the top logo image.
[Obsolete("Do not use")]
public string TopLogoImage { get; set; }
Property Value
- string
- The top logo image.
TopLogoImageAlt
Gets or sets the top logo image alt.
[Obsolete("Do not use")]
public string TopLogoImageAlt { get; set; }
Property Value
- string
- The top logo image alt.
TreeSection
Gets or sets the tree section. Text box to set this value is only visible if ParentPageId is 0.
public string TreeSection { get; set; }
Property Value
- string
- The tree section.
UniqueId
public Guid UniqueId { get; set; }
Property Value
UrlDataProviderParameters
Gets or sets the URL data provider parameters
public string UrlDataProviderParameters { get; set; }
Property Value
UrlDataProviderTypeName
Gets or sets the URL data provider type name
public string UrlDataProviderTypeName { get; set; }
Property Value
UrlIgnoreForChildren
Gets or sets wether the name of this page should be part of the URL for subpages when using the 'path' URL schema.
public bool UrlIgnoreForChildren { get; set; }
Property Value
- bool
- Boolean indicating if the name should be ignored.
UrlName
Gets or sets the name in the URL.
public string UrlName { get; set; }
Property Value
- string
- The name in the URL.
UrlUseAsWritten
Gets or sets wether the UrlName of this page should be used as the URL exactly as typed when using the 'path' URL schema.
public bool UrlUseAsWritten { get; set; }
Property Value
UserManagementPermissions
Gets or sets the user management permissions.
public PagePermissions UserManagementPermissions { get; set; }
Property Value
- PagePermissions
- The user management permissions.
UsesLayout
Gets a value indicating whether page uses layout.
public bool UsesLayout { get; }
Property Value
- bool
true
if page uses layout; otherwise,false
.
Methods
Copy()
Creates a copy of this page and returns it as a transient instance (Not persisted)
public Page Copy()
Returns
- Page
- A new Page instance with state copied from this Page instance
GetBreadcrumbPath()
Gets the path from the root to this page expressed as /menuText1/menuTextN/MenuTextN+1
public string GetBreadcrumbPath()
Returns
- string
- A string representing the path to this page instance
GetByKey(string)
Can be used to look up a concrete object based upon the key.
public IPermissionControlled GetByKey(string key)
Parameters
key
string- Identifier
Returns
- IPermissionControlled
- permissionControlled
GetDisplayName()
Yields a human-readable name for rendering.
public string GetDisplayName()
Returns
- string
- name
GetInheritedPassword()
public string GetInheritedPassword()
Returns
GetInheritedPermissionTemplate()
public string GetInheritedPermissionTemplate()
Returns
GetInheritedProtect()
public bool GetInheritedProtect()
Returns
GetLanguageVersion(int)
Gets the language version of this page as specified with the areaId parameter
public Page GetLanguageVersion(int areaId)
Parameters
areaId
int- The language version to get
Returns
- Page
- A page language version as specified in the areaId
GetPageHrefValue()
Gets the page href value for links based on shortcut settings.
public string GetPageHrefValue()
Returns
- string
- For normal pages, returns Default.aspx?ID={Page.ID}.
Remarks
If the page has a shortcut that will be returned if it is marked as redirect or the shortcut is an external link, mail etc.
GetParent()
Gets the parent of this object, for the purposes of inherited permissions.
public IPermissionControlled GetParent()
Returns
- IPermissionControlled
- parent
Remarks
Return null, if no parent permissions exist
GetPath()
Gets the path from the root page to this page as a list of pages.
public IList<Page> GetPath()
Returns
GetPermissionIdentifier()
Combination of values that form a unique identifier.
public UnifiedPermissionIdentifier GetPermissionIdentifier()
Returns
- UnifiedPermissionIdentifier
- Unique identifier.
MarkAsModified()
public void MarkAsModified()
Publish()
public void Publish()
ResetUrlChangeTracking()
Resets the change tracker for the url.
public void ResetUrlChangeTracking()
SetHidden()
Sets the hidden state.
public void SetHidden()
UnPublish()
public void UnPublish()