C# Class Rebel.Cms.Web.RebelHelper

A utility class for use with front-end development containing many methods for accessing common APIs in Rebel
Mostra file Open project: RebelCMS/rebelcmsxu5

Public Methods

Method Description
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

Method Details

Field() public method

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
return IHtmlString

Field() public method

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
return IHtmlString

FieldKeyValues() public method

Return all key/values stored for a property
public FieldKeyValues ( Content currentPage, string fieldAlias ) : object>.IDictionary
currentPage Content
fieldAlias string
return object>.IDictionary

FieldKeyValues() public method

Return all key/values stored for a property
public FieldKeyValues ( string fieldAlias ) : object>.IDictionary
fieldAlias string
return object>.IDictionary

FieldValues() public method

Return all values stored for a property
public FieldValues ( Content currentPage, string fieldAlias ) : IEnumerable
currentPage Content
fieldAlias string
return IEnumerable

FieldValues() public method

Return all values stored for a property
public FieldValues ( string fieldAlias ) : IEnumerable
fieldAlias string
return IEnumerable

GetContentById() public method

public GetContentById ( HiveId id ) : Content
id HiveId
return Content

GetContentById() public method

public GetContentById ( string id ) : Content
id string
return Content

GetDictionaryItem() public method

public GetDictionaryItem ( string key, string defaultValue = null ) : string
key string
defaultValue string
return string

GetDictionaryItemForLanguage() public method

public GetDictionaryItemForLanguage ( string key, string language, string defaultValue = null ) : string
key string
language string
defaultValue string
return string

GetDynamicContentById() public method

public GetDynamicContentById ( HiveId id, object defaultValue = null ) : dynamic
id HiveId
defaultValue object
return dynamic

GetDynamicContentById() public method

public GetDynamicContentById ( string id ) : dynamic
id string
return dynamic

GetEntityById() public method

Gets the typed entity by the given id.
public GetEntityById ( HiveId id ) : TypedEntity
id HiveId The id.
return TypedEntity

GetEntityById() public method

Gets the typed entity by the given id.
public GetEntityById ( string id ) : TypedEntity
id string The id.
return TypedEntity

GetMediaUrl() public method

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.
return string

GetMediaUrl() public method

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).
return string

GetMediaUrl() public method

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.
return string

GetMediaUrl() public method

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).
return string

GetMediaUrl() public method

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.
return string

GetMediaUrl() public method

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).
return string

GetMediaUrl() public method

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.
return string

GetMediaUrl() public method

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).
return string

GetMediaUrl() public method

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.
return string

GetMediaUrl() public method

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).
return string

GetMediaUrl() public method

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.
return string

GetMediaUrl() public method

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).
return string

GetPreValueModel() public method

Gets the pre value model for the datatype with the specified id.
public GetPreValueModel ( HiveId dataTypeId ) : PreValueModel
dataTypeId HiveId The data type id.
return PreValueModel

GetPreValueModel() public method

Gets the pre value model for the datatype with the specified id.
public GetPreValueModel ( string dataTypeId ) : PreValueModel
dataTypeId string The data type id.
return PreValueModel

GetUrl() public method

Gets the URL for the entity with the given id.
public GetUrl ( HiveId entityId ) : string
entityId HiveId The entity id.
return string

GetUrl() public method

Gets the URL for the given entity.
public GetUrl ( TypedEntity entity ) : string
entity TypedEntity The entity.
return string

GetUrl() public method

Gets the URL for the entity with the given id.
public GetUrl ( string entityId ) : string
entityId string The entity id.
return string

RebelHelper() public method

public RebelHelper ( ControllerContext controllerContext, IRoutableRequestContext requestContext, IRenderModelFactory modelFactory ) : System.Collections.Generic
controllerContext ControllerContext
requestContext IRoutableRequestContext
modelFactory IRenderModelFactory
return System.Collections.Generic

RenderMacro() public method

Renders the macro with the specified alias.
public RenderMacro ( string alias ) : IHtmlString
alias string The alias.
return IHtmlString

RenderMacro() public method

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.
return IHtmlString

Truncate() public method

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