Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering parts into different zones in Orchard CMS

I'm new to Orchard CMS and wondered if it was possible to render content parts setup in the page content type into a different zone rather than the content itself.

For instance, I setup a TextField which holds an image url to be used as a page Title but is placed in a different area from the content itself.

Can anyone point me in the right direction?

like image 329
Sanction10 Avatar asked May 15 '11 14:05

Sanction10


3 Answers

If you mean sending parts to a zone that is not inside the top-level Content zone, you can try this approach: http://weblogs.asp.net/bleroy/archive/2011/03/26/dispatching-orchard-shapes-to-arbitrary-zones.aspx We are also considering various extensions to placement for future versions of Orchard.

like image 62
Bertrand Le Roy Avatar answered Nov 14 '22 09:11

Bertrand Le Roy


As of Orchard 1.5 you can inject a part into any zone using your theme's placement.info file. This uses zone placement.

Here is an example that would place blog post's tags in the AssideFirst zone when the blog post was being shown in detail view.

<Placement>
    <Match ContentType="BlogPost">
        <Match DisplayType="Detail">
            <Place Parts_Tags_ShowTags="/AssideFirst:1"/>
        </Match>
    </Match>
</Placement>

The number after the zone name is the position. A smaller number will make it appear above other widgets in this zone and a larger number will make it appear lower down.

like image 43
Richard Garside Avatar answered Nov 14 '22 10:11

Richard Garside


You can customize content parts' display properties via Placement.info file. It's a very simple, yet powerful tool that allows you to change rendering zones, parts' ordering and such.

Could you please elaborate more about your scenario?

like image 21
Piotr Szmyd Avatar answered Nov 14 '22 10:11

Piotr Szmyd