Interface IRenderService
Block-Rendering system. It's responsible for taking a Block and delivering HTML for the output.
It's used for InnerContent, so that Razor-Code can easily render additional content blocks.
See also Inner Content (Content Within Other Content)
[PublicApi]
public interface IRenderService
Remarks
This replaces the now obsolete ToSic.Sxc.Blocks.Render
History
- Introduced in v12.05 but on another namespace which still works for compatibility
- Moved to ToSic.Sxc.Services in v13
Methods
All(ICanBeItem, NoParamOrder, string, string, int, string)
Render content-blocks into a larger html-block containing placeholders
IRawHtmlString All(ICanBeItem parent, NoParamOrder noParamOrder = default, string field = null, string apps = null, int max = 100, string merge = null)
Parameters
parent
ICanBeItemThe parent-item containing the content-blocks and providing edit-context
noParamOrder
NoParamOrderfield
stringRequired: Field containing the content-blocks.
apps
stringBETA / WIP
max
intBETA / WIP
merge
stringOptional: html-text containing special placeholders.
Returns
- IRawHtmlString
Remarks
- Changed result object to
IRawHtmlString
in v16.02 fromIHybridHtmlString
Module(int, int, NoParamOrder, object)
Get a 2sxc module rendered directly.
IRenderResult Module(int pageId, int moduleId, NoParamOrder noParamOrder = default, object data = null)
Parameters
pageId
intmoduleId
intnoParamOrder
NoParamOrderdata
objectData to give the Razor as
DynamicModel
- new 15.07
Returns
- IRenderResult
An HTML-String which can be added to the output directly. The object also has additional information like assets or page changes, which are not applied when using this render command.
Remarks
New in 2sxc 13.02
One(ICanBeItem, NoParamOrder, ICanBeEntity, object, string, Guid?)
Render one content block This is accessed through DynamicEntity.Render() At the moment it MUST stay internal, as it's not clear what API we want to surface
IRawHtmlString One(ICanBeItem parent, NoParamOrder noParamOrder = default, ICanBeEntity item = null, object data = null, string field = null, Guid? newGuid = null)
Parameters
parent
ICanBeItemThe parent-item containing the content-blocks and providing edit-context
noParamOrder
NoParamOrderitem
ICanBeEntityThe content-block item to render. Optional, by default the same item is used as the context.
data
objectData to give the Razor as
DynamicModel
- new 15.07field
stringOptional:
newGuid
Guid?Internal: this is the guid given to the item when being created in this block. Important for the inner-content functionality to work.
Returns
- IRawHtmlString
Remarks
- Changed result object to
IRawHtmlString
in v16.02 fromIHybridHtmlString