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

Class ThemeUtility

page extension for theming support

Inheritance
System.Object
ThemeUtility
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.PageExtensions
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
[PagePlugIn("Theming support", "Support theming for EPiServer pages.")]
public class ThemeUtility

Constructors

ThemeUtility()

Initializes a new instance of the ThemeUtility class.

Declaration
public ThemeUtility()

Properties

OptionFlag

Flag value to determine if this plug in should be enabled.

Declaration
public static int OptionFlag { get; }
Property Value
Type Description
System.Int32

Methods

Attach(Page)

Attach to a PageBase class.

Declaration
public void Attach(Page page)
Parameters
Type Name Description
System.Web.UI.Page page

The page to attach to.

GetCssThemeUrl(Page, String)

Get the full url to a css file with theming support.

Declaration
public static string GetCssThemeUrl(Page page, string cssPath)
Parameters
Type Name Description
System.Web.UI.Page page

The currently executing page.

System.String cssPath

The url relative to the theme Styles folder.

Returns
Type Description
System.String

The full url to the css file.

GetExtensionCssThemeUrl(Page, String)

Get the full url to a css file with theming support from the Extensions folder.

Declaration
public static string GetExtensionCssThemeUrl(Page page, string cssPath)
Parameters
Type Name Description
System.Web.UI.Page page

The currently executing page.

System.String cssPath

The url relative to the theme Styles/Extensions folder.

Returns
Type Description
System.String

The full url to the css file.

GetImageThemeUrl(Page, String)

Get the full url to an image with theming support.

Declaration
public static string GetImageThemeUrl(Page page, string imagePath)
Parameters
Type Name Description
System.Web.UI.Page page

The currently executing page.

System.String imagePath

The url relative to the theme Images folder.

Returns
Type Description
System.String

The full url to the image.

GetImageThemeUrl(Page, String, String)

Get the full url to an image with theming support using a specific theme.

Declaration
public static string GetImageThemeUrl(Page page, string imagePath, string theme)
Parameters
Type Name Description
System.Web.UI.Page page

The currently executing page.

System.String imagePath

The url relative to the theme Images folder.

System.String theme

The name of the theme.

Returns
Type Description
System.String

The full url to the image.

GetSystemTheme()

Get name of system theme.

Declaration
public static string GetSystemTheme()
Returns
Type Description
System.String

System theme set up in configuration file, or "Default" if none specified.

Initialize(Int32)

Method called at system startup to initialize this plug in.

Declaration
public static void Initialize(int optionFlag)
Parameters
Type Name Description
System.Int32 optionFlag

The option flag value assigned to this plug in.

Remarks

Using the plugin attribute [PagePlugIn] requires the class to contain a static void method named "Initialize" which will be called to attach to suitable event handlers.

RegisterThemeCss(Page, String)

Add a css file to the page header.

Declaration
public static void RegisterThemeCss(Page page, string cssPath)
Parameters
Type Name Description
System.Web.UI.Page page

The currently executing page.

System.String cssPath

The url to the css file.

Remarks

Will add a ThemeCss control to the Header of the page.

Extension Methods