Understanding Shapes: Advanced Orchard Concepts for Intermediate Developers

Orchard Core · 9K views · 2013 · 1:11:44

Open on YouTube

Web developmentSoftware architecture & designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering Orchard CMS questions about shapes, placement, and shape relocation, since it is the author's own walkthrough of the system.

Recommended by 3 people across 3 different months, 2013 to 2016.

What it is

A Harvest conference session by Sebastien Ros, an Orchard CMS core developer, on Shapes, the foundation of Orchard's rendering. It covers theming, placement, drivers, and some deep dives into the Shape architecture.

What people said

Recommends Xceno · 2013-12 · Stack Overflow · on “Orchard CMS: Modifying a menu item alternate and iterating over the items”

just look at the whole MenuItemLink.cshtml file where it is assigned and debug your way through it. That will give you some insights. You can also watch this video for more background information in general: [this video]

Recommends Sébastien Ros - MSFT · 2016-05 · Stack Overflow · on “Pass the current Model down to a more specific shape”

If the first argument of the dynamic method is a type, then this will be used as the model. New.YourShape(typeof(YourType)) See this video for the details: [this video]

Recommends rtpHarry · 2016-09 · Stack Overflow · on “Is it possible to render a part twice in one display type? - Orchard CMS”

Render the zone twice Probably not through just using the placement.info file but if you edit the .cshtml view you can just render a zone twice. For a test I just edited my blog detail view to have this code: @Display(Model.Content) @Display(Model.Content) It worked, and displayed it twice. It's something you should probably be careful with this as in that example it rendered out my Disqus comments twice which created a clash because the same id was used twice on a single page. Fine tune it with Part Relocation If you need to pull a single bit of content (a shape/part) out of an existing zone you can also do it with something called Part Relocation which is explained in this Orchard Harvest

Recommends rtpHarry · 2016-09 · Stack Overflow · on “OrchardCMS Getting the Attached Layout Part from the CustomType object in a Shape Alias”

What you're looking for is Shape Relocation. There is an introduction to it here in Sebastien's Harvest 2015 Shapes Talk [this video] . The idea is as follows: You want to move a part around on the page but you don't want to take full control over the rendering of it, you just want to move the existing bit to somewhere else on the page. Shape Relocation First you make up a new zone in your view, name it what you like. In your case it would look something like this: <div id="@id" style="background: url(@backgroundPath)" class="@css"> <div class="container"> <div class="row"> <div class="col-sm-12 m-t-250"> @Display(Model.MyNewCustomLayoutZone) <div class="btn-list"> <a href="#@nextID" class="btn b