C# Класс Sitecore.SharedSource.Commons.Utilities.PresentationUtil

Utilities for dealing with presentation settings in Sitecore.
Показать файл Открыть проект

Открытые методы

Метод Описание
GetDeviceDefinition ( Item theItem, DeviceItem device ) : DeviceDefinition

Gets the device definition for a given item and device.

GetPlaceholderKeyName ( System.Web.UI.UserControl sublayout ) : string

Gets the name of the placeholder key that the passed in sublayout is bound to. This will return an empty string if for some reason we cannot get the placeholder name. You would use this from the code behind of a sublayout. So for example if I had a sublayout sltList and I wanted to know what placeholder it was bound to I would have something this in the code behind "string plcKeyName = PresentationUtil.GetPlaceholderKeyName(this);"

ItemHasPresentationSettingsForDevice ( Item theItem, DeviceItem device ) : bool

Checks to see if an item has presentation settings for the passed in device

ItemHasPresentationSettingsForLayout ( Item theItem, DeviceItem device, LayoutItem layoutItem ) : bool

Checks to see if the passed in item has presentation settings for the provided device and layout.

ItemHasPresentationSettingsForSublayout ( Item theItem, DeviceItem device, SublayoutItem sublayoutItem ) : bool

Checks to see if the passed in item has presentation settings for the provided device and sublayout.

TemplateHasPresentationSetDirectlyOnTemplate ( TemplateItem template ) : bool

Checks whether the presenation settings are set directly on a template, this should ususally be set on the standard values.

Описание методов

GetDeviceDefinition() публичный статический Метод

Gets the device definition for a given item and device.
public static GetDeviceDefinition ( Item theItem, DeviceItem device ) : DeviceDefinition
theItem Item The item.
device DeviceItem The device.
Результат DeviceDefinition

GetPlaceholderKeyName() публичный статический Метод

Gets the name of the placeholder key that the passed in sublayout is bound to. This will return an empty string if for some reason we cannot get the placeholder name. You would use this from the code behind of a sublayout. So for example if I had a sublayout sltList and I wanted to know what placeholder it was bound to I would have something this in the code behind "string plcKeyName = PresentationUtil.GetPlaceholderKeyName(this);"
public static GetPlaceholderKeyName ( System.Web.UI.UserControl sublayout ) : string
sublayout System.Web.UI.UserControl The sublayout.
Результат string

ItemHasPresentationSettingsForDevice() публичный статический Метод

Checks to see if an item has presentation settings for the passed in device
public static ItemHasPresentationSettingsForDevice ( Item theItem, DeviceItem device ) : bool
theItem Item The item to check.
device DeviceItem The device to check for.
Результат bool

ItemHasPresentationSettingsForLayout() публичный статический Метод

Checks to see if the passed in item has presentation settings for the provided device and layout.
public static ItemHasPresentationSettingsForLayout ( Item theItem, DeviceItem device, LayoutItem layoutItem ) : bool
theItem Item The item.
device DeviceItem The device.
layoutItem LayoutItem The layout item.
Результат bool

ItemHasPresentationSettingsForSublayout() публичный статический Метод

Checks to see if the passed in item has presentation settings for the provided device and sublayout.
public static ItemHasPresentationSettingsForSublayout ( Item theItem, DeviceItem device, SublayoutItem sublayoutItem ) : bool
theItem Item The item.
device DeviceItem The device.
sublayoutItem SublayoutItem The sublayout item.
Результат bool

TemplateHasPresentationSetDirectlyOnTemplate() публичный статический Метод

Checks whether the presenation settings are set directly on a template, this should ususally be set on the standard values.
public static TemplateHasPresentationSetDirectlyOnTemplate ( TemplateItem template ) : bool
template TemplateItem The template to check.
Результат bool