Create a new Render Hook
It is very easy to create a render hook, so other plugins can attach and inject html in its placeholder. To do that just paste a code in a Razor view, very similarly to including a view component via a tag helper.
Properties
The hook supports the following properties, which will be also provided as parameters to all attached methods:
name | description |
---|---|
model |
object type: default value: is required: Any specific model you want to provide to the hook attachments. Useful when you loop through items in a list and want to provide the current item |
page-model |
object type: default value: is required: The current page model. |
placeholder |
object type: default value: is required: An unique name defining the position |
IMPORTANT: In our application master page there are already render hooks included for: head-top
, head-bottom
,body-toop
, body-bottom
.
Example
Paste the following code in a Razor view:
<vc:render-hook placeholder="head-top" page-model="@Model" model="null"></vc:render-hook>