• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    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)

    Namespace: ToSic.Sxc.Services
    Assembly: ToSic.Sxc.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    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

    | Improve this Doc View Source

    All(DynamicEntity, String, String, String, Int32, String)

    Render content-blocks into a larger html-block containing placeholders

    Declaration
    IHybridHtmlString All(DynamicEntity parent, string noParamOrder = "Params must be named (https://r.2sxc.org/named-params)", string field = null, string apps = null, int max = 100, string merge = null)
    Parameters
    Type Name Description
    DynamicEntity parent

    The parent-item containing the content-blocks and providing edit-context

    System.String noParamOrder

    see Convention: Named Parameters

    System.String field

    Required: Field containing the content-blocks.

    System.String apps

    BETA / WIP

    System.Int32 max

    BETA / WIP

    System.String merge

    Optional: html-text containing special placeholders.

    Returns
    Type Description
    IHybridHtmlString
    | Improve this Doc View Source

    Module(Int32, Int32, String, Object)

    Get a 2sxc module rendered directly.

    Declaration
    IRenderResult Module(int pageId, int moduleId, string noParamOrder = "Params must be named (https://r.2sxc.org/named-params)", object data = null)
    Parameters
    Type Name Description
    System.Int32 pageId
    System.Int32 moduleId
    System.String noParamOrder

    see Convention: Named Parameters

    System.Object data

    Data to give the Razor as DynamicModel - new 15.07

    Returns
    Type Description
    ToSic.Sxc.Blocks.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

    | Improve this Doc View Source

    One(DynamicEntity, String, IDynamicEntity, Object, String, Nullable<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

    Declaration
    IHybridHtmlString One(DynamicEntity parent, string noParamOrder = "Params must be named (https://r.2sxc.org/named-params)", IDynamicEntity item = null, object data = null, string field = null, Guid? newGuid = default(Guid? ))
    Parameters
    Type Name Description
    DynamicEntity parent

    The parent-item containing the content-blocks and providing edit-context

    System.String noParamOrder

    see Convention: Named Parameters

    IDynamicEntity item

    The content-block item to render. Optional, by default the same item is used as the context.

    System.Object data

    Data to give the Razor as DynamicModel - new 15.07

    System.String field

    Optional:

    System.Nullable<System.Guid> newGuid

    Internal: this is the guid given to the item when being created in this block. Important for the inner-content functionality to work.

    Returns
    Type Description
    IHybridHtmlString
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX