Rendering parts into different zones in Orchard CMS
I'm 开发者_Python百科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?
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.
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.
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?
精彩评论