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

Показать файл Открыть проект

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

Метод Описание
GetBaseTemplates ( System.Item item ) : TemplateItem>.IDictionary

Returns a LinkField value from a Sitecore LinkField. If the field is null, or does not contain a value, it'll create an empty LinkField with a Url of "#"

Returns a hash map of TemplateItems comprised of all the base templates of the specified Sitecore item. Notice that the lookup stops at the "Standard Template", so base templates such as "Appearance", "Masters", "Workflow", etc. won't be included in the list.

GetCheckboxValue ( System.Item item, String fieldName ) : bool

Provides a boolean value for Checkboxes.

GetDateFieldValue ( System.Item item, String fieldName ) : System.DateTime

Returns a DateTime value from a Sitecore date/time field. If the item does not contain a valid DateField, or the DateField is not set, then DateTime.MinValue will be returned.

GetSite ( System.Item item ) : SiteInfo

Find proper site based on the passed item

GetTextFieldValue ( System.Item item, String fieldName ) : String

Return a string value from a Sitecore text based field

HasBaseTemplate ( System.Item item, string templateName ) : bool

Determines whether a given sitecore item descends from the specified base template. Notice that the lookup stops at the "Standard Template", so base templates such as "Appearance", "Masters", "Workflow", etc. won't be included in the search.

HasRelationToTemplate ( Database db, string templateId, System.Item item ) : bool

Determines whether a given Sitecore item is of a certain template or descends from the provided tempalte Id. Standard Tempaltes are excluded.

HasRelationToTemplate ( string templateId, System.Item item ) : bool

Determines whether a given Sitecore item is of a certain template or descends from the provided tempalte Id. Standard Tempaltes are excluded.

Приватные методы

Метод Описание
AddBaseTemplates ( TemplateItem>.Dictionary dict, TemplateItem template ) : void

Recursively look up base templates for the specified item and add them to the list. Notice that the lookup stops at the "Standard Template", so base templates such as "Appearance", "Masters", "Workflow", etc. won't be included in the list.

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

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

Returns a LinkField value from a Sitecore LinkField. If the field is null, or does not contain a value, it'll create an empty LinkField with a Url of "#" Returns a hash map of TemplateItems comprised of all the base templates of the specified Sitecore item. Notice that the lookup stops at the "Standard Template", so base templates such as "Appearance", "Masters", "Workflow", etc. won't be included in the list.
public static GetBaseTemplates ( System.Item item ) : TemplateItem>.IDictionary
item System.Item Sitecore Item with a LinkField
Результат TemplateItem>.IDictionary

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

Provides a boolean value for Checkboxes.
public static GetCheckboxValue ( System.Item item, String fieldName ) : bool
item System.Item Sitecore Item with Checkbox
fieldName String Name of Checkbox Field
Результат bool

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

Returns a DateTime value from a Sitecore date/time field. If the item does not contain a valid DateField, or the DateField is not set, then DateTime.MinValue will be returned.
public static GetDateFieldValue ( System.Item item, String fieldName ) : System.DateTime
item System.Item Sitecore Item with a date/time field
fieldName String Name of Sitecore field
Результат System.DateTime

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

Find proper site based on the passed item
public static GetSite ( System.Item item ) : SiteInfo
item System.Item
Результат SiteInfo

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

Return a string value from a Sitecore text based field
public static GetTextFieldValue ( System.Item item, String fieldName ) : String
item System.Item Sitecore Item with a text field
fieldName String Name of Sitecore field
Результат String

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

Determines whether a given sitecore item descends from the specified base template. Notice that the lookup stops at the "Standard Template", so base templates such as "Appearance", "Masters", "Workflow", etc. won't be included in the search.
public static HasBaseTemplate ( System.Item item, string templateName ) : bool
item System.Item a sitecore item
templateName string the name of the base template you're looking for
Результат bool

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

Determines whether a given Sitecore item is of a certain template or descends from the provided tempalte Id. Standard Tempaltes are excluded.
public static HasRelationToTemplate ( Database db, string templateId, System.Item item ) : bool
db Database Sitecore Database
templateId string String Template Id
item System.Item Sitecore Item
Результат bool

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

Determines whether a given Sitecore item is of a certain template or descends from the provided tempalte Id. Standard Tempaltes are excluded.
public static HasRelationToTemplate ( string templateId, System.Item item ) : bool
templateId string String Template Id
item System.Item Sitecore Item
Результат bool