Contribute to Docs Contribute to Docs

Partials

Besides adding custom stylesheets and scripts into the manager interface you can also add global partial views into the Layout of the manager. This is useful if you for example want to add a modal for a custom field that should be available on all manager views, or perhaps even a custom toolbar.

Adding The Partial

The partial collection can be accessed from the Partials property. This collection holds all custom partials that has been added by your own code, or other modules. Below is an example of how to add a custom partial to the collection.

using Piranha;

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    ...

    App.Modules.Manager()
        .Partials.Add("Partial/_MyModal");

    ...
}

All custom partials are rendered at the end of the body tag after the built-in modals have been added.