C# Класс Rebel.Cms.Web.RebelHelper

A utility class for use with front-end development containing many methods for accessing common APIs in Rebel
Показать файл Открыть проект

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

Метод Описание
Field ( Content currentPage, string fieldAlias, string valueAlias = "", string altFieldAlias = "", string altValueAlias = "", string altText = "", string insertBefore = "", string insertAfter = "", bool recursive = false, bool convertLineBreaks = false, bool removeParagraphTags = false, RebelRenderItemCaseType casing = RebelRenderItemCaseType.Unchanged, RebelRenderItemEncodingType encoding = RebelRenderItemEncodingType.Unchanged, string formatString = "" ) : IHtmlString
Field ( string fieldAlias, string valueAlias = "", string altFieldAlias = "", string altValueAlias = "", string altText = "", string insertBefore = "", string insertAfter = "", bool recursive = false, bool convertLineBreaks = false, bool removeParagraphTags = false, RebelRenderItemCaseType casing = RebelRenderItemCaseType.Unchanged, RebelRenderItemEncodingType encoding = RebelRenderItemEncodingType.Unchanged, string formatString = "" ) : IHtmlString
FieldKeyValues ( Content currentPage, string fieldAlias ) : object>.IDictionary

Return all key/values stored for a property

FieldKeyValues ( string fieldAlias ) : object>.IDictionary

Return all key/values stored for a property

FieldValues ( Content currentPage, string fieldAlias ) : IEnumerable

Return all values stored for a property

FieldValues ( string fieldAlias ) : IEnumerable

Return all values stored for a property

GetContentById ( HiveId id ) : Content
GetContentById ( string id ) : Content
GetDictionaryItem ( string key, string defaultValue = null ) : string
GetDictionaryItemForLanguage ( string key, string language, string defaultValue = null ) : string
GetDynamicContentById ( HiveId id, object defaultValue = null ) : dynamic
GetDynamicContentById ( string id ) : dynamic
GetEntityById ( HiveId id ) : TypedEntity

Gets the typed entity by the given id.

GetEntityById ( string id ) : TypedEntity

Gets the typed entity by the given id.

GetMediaUrl ( HiveId id ) : string

Gets the URL of the file in the first upload field found on the TypedEntity with the given id

GetMediaUrl ( HiveId id, int size ) : string

Gets the URL of the file in the first upload field found on the TypedEntity with the given id, at the specified size

GetMediaUrl ( HiveId id, string propertyAlias ) : string

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id

GetMediaUrl ( HiveId id, string propertyAlias, int size ) : string

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id, at the specified size

GetMediaUrl ( TypedEntity entity ) : string

Gets the URL of the file in the first upload field found on the given TypedEntity

GetMediaUrl ( TypedEntity entity, int size ) : string

Gets the URL of the file in the first upload field found on the given TypedEntity at the specific size

GetMediaUrl ( TypedEntity entity, string propertyAlias ) : string

Gets the URL of the file in the upload field with the given property alias on the given TypedEntity

GetMediaUrl ( TypedEntity entity, string propertyAlias, int size ) : string

Gets the URL of the file in the upload field with the given property alias on the given TypedEntity at the specific size

GetMediaUrl ( string idOrPropertyAlias ) : string

Gets the URL of the file in the first upload field found on the TypedEntity with the given id

GetMediaUrl ( string idOrPropertyAlias, int size ) : string

Gets the URL of the file in the first upload field found on the TypedEntity with the given id, at the specified size

GetMediaUrl ( string id, string propertyAlias ) : string

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id

GetMediaUrl ( string id, string propertyAlias, int size ) : string

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id, at the specified size

GetPreValueModel ( HiveId dataTypeId ) : PreValueModel

Gets the pre value model for the datatype with the specified id.

GetPreValueModel ( string dataTypeId ) : PreValueModel

Gets the pre value model for the datatype with the specified id.

GetUrl ( HiveId entityId ) : string

Gets the URL for the entity with the given id.

GetUrl ( TypedEntity entity ) : string

Gets the URL for the given entity.

GetUrl ( string entityId ) : string

Gets the URL for the entity with the given id.

RebelHelper ( ControllerContext controllerContext, IRoutableRequestContext requestContext, IRenderModelFactory modelFactory ) : System.Collections.Generic
RenderMacro ( string alias ) : IHtmlString

Renders the macro with the specified alias.

RenderMacro ( string alias, object parameters ) : IHtmlString

Renders the macro with the specified alias, passing in the specified parameters.

Truncate ( string original, int maxLength, string suffix = "..." ) : string

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

Field() публичный Метод

public Field ( Content currentPage, string fieldAlias, string valueAlias = "", string altFieldAlias = "", string altValueAlias = "", string altText = "", string insertBefore = "", string insertAfter = "", bool recursive = false, bool convertLineBreaks = false, bool removeParagraphTags = false, RebelRenderItemCaseType casing = RebelRenderItemCaseType.Unchanged, RebelRenderItemEncodingType encoding = RebelRenderItemEncodingType.Unchanged, string formatString = "" ) : IHtmlString
currentPage Content
fieldAlias string
valueAlias string
altFieldAlias string
altValueAlias string
altText string
insertBefore string
insertAfter string
recursive bool
convertLineBreaks bool
removeParagraphTags bool
casing RebelRenderItemCaseType
encoding RebelRenderItemEncodingType
formatString string
Результат IHtmlString

Field() публичный Метод

public Field ( string fieldAlias, string valueAlias = "", string altFieldAlias = "", string altValueAlias = "", string altText = "", string insertBefore = "", string insertAfter = "", bool recursive = false, bool convertLineBreaks = false, bool removeParagraphTags = false, RebelRenderItemCaseType casing = RebelRenderItemCaseType.Unchanged, RebelRenderItemEncodingType encoding = RebelRenderItemEncodingType.Unchanged, string formatString = "" ) : IHtmlString
fieldAlias string
valueAlias string
altFieldAlias string
altValueAlias string
altText string
insertBefore string
insertAfter string
recursive bool
convertLineBreaks bool
removeParagraphTags bool
casing RebelRenderItemCaseType
encoding RebelRenderItemEncodingType
formatString string
Результат IHtmlString

FieldKeyValues() публичный Метод

Return all key/values stored for a property
public FieldKeyValues ( Content currentPage, string fieldAlias ) : object>.IDictionary
currentPage Content
fieldAlias string
Результат object>.IDictionary

FieldKeyValues() публичный Метод

Return all key/values stored for a property
public FieldKeyValues ( string fieldAlias ) : object>.IDictionary
fieldAlias string
Результат object>.IDictionary

FieldValues() публичный Метод

Return all values stored for a property
public FieldValues ( Content currentPage, string fieldAlias ) : IEnumerable
currentPage Content
fieldAlias string
Результат IEnumerable

FieldValues() публичный Метод

Return all values stored for a property
public FieldValues ( string fieldAlias ) : IEnumerable
fieldAlias string
Результат IEnumerable

GetContentById() публичный Метод

public GetContentById ( HiveId id ) : Content
id HiveId
Результат Content

GetContentById() публичный Метод

public GetContentById ( string id ) : Content
id string
Результат Content

GetDictionaryItem() публичный Метод

public GetDictionaryItem ( string key, string defaultValue = null ) : string
key string
defaultValue string
Результат string

GetDictionaryItemForLanguage() публичный Метод

public GetDictionaryItemForLanguage ( string key, string language, string defaultValue = null ) : string
key string
language string
defaultValue string
Результат string

GetDynamicContentById() публичный Метод

public GetDynamicContentById ( HiveId id, object defaultValue = null ) : dynamic
id HiveId
defaultValue object
Результат dynamic

GetDynamicContentById() публичный Метод

public GetDynamicContentById ( string id ) : dynamic
id string
Результат dynamic

GetEntityById() публичный Метод

Gets the typed entity by the given id.
public GetEntityById ( HiveId id ) : TypedEntity
id HiveId The id.
Результат TypedEntity

GetEntityById() публичный Метод

Gets the typed entity by the given id.
public GetEntityById ( string id ) : TypedEntity
id string The id.
Результат TypedEntity

GetMediaUrl() публичный Метод

Gets the URL of the file in the first upload field found on the TypedEntity with the given id
public GetMediaUrl ( HiveId id ) : string
id HiveId The id.
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the first upload field found on the TypedEntity with the given id, at the specified size
public GetMediaUrl ( HiveId id, int size ) : string
id HiveId The id.
size int The size (must be a prevalue on the upload property editor).
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id
public GetMediaUrl ( HiveId id, string propertyAlias ) : string
id HiveId The id.
propertyAlias string The property alias.
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id, at the specified size
public GetMediaUrl ( HiveId id, string propertyAlias, int size ) : string
id HiveId The id.
propertyAlias string The property alias.
size int The size (must be a prevalue on the upload property editor).
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the first upload field found on the given TypedEntity
public GetMediaUrl ( TypedEntity entity ) : string
entity TypedEntity The entity.
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the first upload field found on the given TypedEntity at the specific size
public GetMediaUrl ( TypedEntity entity, int size ) : string
entity TypedEntity The entity.
size int The size (must be a prevalue on the upload property editor).
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the upload field with the given property alias on the given TypedEntity
public GetMediaUrl ( TypedEntity entity, string propertyAlias ) : string
entity TypedEntity The entity.
propertyAlias string The property alias.
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the upload field with the given property alias on the given TypedEntity at the specific size
public GetMediaUrl ( TypedEntity entity, string propertyAlias, int size ) : string
entity TypedEntity The entity.
propertyAlias string The property alias.
size int The size (must be a prevalue on the upload property editor).
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the first upload field found on the TypedEntity with the given id
public GetMediaUrl ( string idOrPropertyAlias ) : string
idOrPropertyAlias string The id or property alias.
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the first upload field found on the TypedEntity with the given id, at the specified size
public GetMediaUrl ( string idOrPropertyAlias, int size ) : string
idOrPropertyAlias string The id or property alias.
size int The size (must be a prevalue on the upload property editor).
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id
public GetMediaUrl ( string id, string propertyAlias ) : string
id string The id.
propertyAlias string The property alias.
Результат string

GetMediaUrl() публичный Метод

Gets the URL of the file in the upload field with the given property alias on the TypedEntity with the given id, at the specified size
public GetMediaUrl ( string id, string propertyAlias, int size ) : string
id string The id.
propertyAlias string The property alias.
size int The size (must be a prevalue on the upload property editor).
Результат string

GetPreValueModel() публичный Метод

Gets the pre value model for the datatype with the specified id.
public GetPreValueModel ( HiveId dataTypeId ) : PreValueModel
dataTypeId HiveId The data type id.
Результат PreValueModel

GetPreValueModel() публичный Метод

Gets the pre value model for the datatype with the specified id.
public GetPreValueModel ( string dataTypeId ) : PreValueModel
dataTypeId string The data type id.
Результат PreValueModel

GetUrl() публичный Метод

Gets the URL for the entity with the given id.
public GetUrl ( HiveId entityId ) : string
entityId HiveId The entity id.
Результат string

GetUrl() публичный Метод

Gets the URL for the given entity.
public GetUrl ( TypedEntity entity ) : string
entity TypedEntity The entity.
Результат string

GetUrl() публичный Метод

Gets the URL for the entity with the given id.
public GetUrl ( string entityId ) : string
entityId string The entity id.
Результат string

RebelHelper() публичный Метод

public RebelHelper ( ControllerContext controllerContext, IRoutableRequestContext requestContext, IRenderModelFactory modelFactory ) : System.Collections.Generic
controllerContext ControllerContext
requestContext IRoutableRequestContext
modelFactory IRenderModelFactory
Результат System.Collections.Generic

RenderMacro() публичный Метод

Renders the macro with the specified alias.
public RenderMacro ( string alias ) : IHtmlString
alias string The alias.
Результат IHtmlString

RenderMacro() публичный Метод

Renders the macro with the specified alias, passing in the specified parameters.
public RenderMacro ( string alias, object parameters ) : IHtmlString
alias string The alias.
parameters object The parameters.
Результат IHtmlString

Truncate() публичный Метод

public Truncate ( string original, int maxLength, string suffix = "..." ) : string
original string
maxLength int
suffix string
Результат string