Rendering to arbitrary zones from a template

Topics: Core, Customizing Orchard, General
Dec 10, 2013 at 11:12 PM
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 3:01 AM
Edited Dec 11, 2013 at 3: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 7:42 AM
Thanks for you help. Its great this someone has already implemented this.