This project is read-only.

Rendering to arbitrary zones from a template

Topics: Core, Customizing Orchard, General
Dec 11, 2013 at 12:12 AM
Is there a way to render a HTML section to an arbitrary zone.

i.e from a existing template:
@using (WorkContext.Layout.BeforeMain.Add("2")) {
    <p>Render this to BeforeMain Zone!</p>
All I want to do at this stage is render a Link in the BeforeMain Zone for a particular content type.

I could create a custom link part or a field and attach that to the content type. Although That seems way to involved for my simple task.
Dec 11, 2013 at 4:01 AM
Edited Dec 11, 2013 at 4:01 AM
@using(Capture(Layout.BeforeMain, "2"){

This seems exactly what you need. Keep in mind that template containing this code needs to be executed before Layout.BeforeMain is rendered.
Dec 11, 2013 at 8:42 AM
Thanks for you help. Its great this someone has already implemented this.