Page tag helpers and slots

Put your own content inside a generated page

Each generated page is rendered by a tag helper. In an overridden page, keep the tag helper, and fill its slots to add content in the right places.

Areas/StellarAdmin/Views/Bookings/View.cshtml
@model ResourceViewPageViewModel
@{
    ViewData["Title"] = Model.Title;
}

<sa-view-page model="Model">
    <sa-slot-content name="post-page-actions">
        <sa-button-link href="@($"/invoices/{Model.EntityId}")" variant="ButtonVariant.Outline">
            Invoice
        </sa-button-link>
    </sa-slot-content>
    <sa-slot-content name="post-view-fields">
        <sa-card>
            <sa-card-content>Payment history goes here.</sa-card-content>
        </sa-card>
    </sa-slot-content>
</sa-view-page>

The tag helpers

TagUsed bySlots
<sa-index-page>Indexpre-page-actions, post-page-actions
<sa-form-page>Create and editpre-form-fields, post-form-fields, form-leading-actions, pre-form-actions, post-form-actions
<sa-view-page>Viewpre-page-actions, post-page-actions, pre-view-fields, post-view-fields

The page actions are the buttons in the header, like Create on the index page. The form actions are the buttons at the bottom of a form.

The edit page puts its Delete button in form-leading-actions, so filling that slot replaces it.

The index page has no slot between its header and the grid. Put content above or below the whole page instead.

Attributes

AttributeWhat it does
modelThe page's model. Pass Model.
viewRenders the page through your own partial instead of the built-in one.
classExtra classes for the page.

On this page