dispatching to zones from module controller

Topics: Customizing Orchard, Writing modules, Writing themes
Aug 25, 2011 at 2:11 PM

hello all, 

if I have a module which is pulling content in from multiple sources and then I want to dispatch various shapes to different zones in the layout how do I do this? I'm assuming I can only use dynamic shapes here as well rather than statically typed views?


thanks for any info


Aug 25, 2011 at 3:31 PM

When returning shapes from drivers, you can return several ones. Look at the Blog Post driver for instance. And the placement.info can define where they should be rendered, independently.

Aug 25, 2011 at 9:20 PM

I'm in a controller not a driver - I'm not returning content items.

My controller is pulling items from webservices which I want to then render into the orchard layout. I've tried using Bertrand's technique from here http://weblogs.asp.net/bleroy/archive/2011/03/26/dispatching-orchard-shapes-to-arbitrary-zones.aspx which does work but I still need to return some sort of ActionResult?

On a similar line of questioning if I build a shape like this


  SomeData1: someSortOfData,

  SomeData2: someOtherSortOfData);

and I want to render those sub-parts using different "partials" how do i do this. I can see I build my template Parts/MyShape.cshtml but if I want to render shapes within that how do I do that? I can see @Display being used all over the shop but I dont think I quite grok it. Any tips?



Aug 25, 2011 at 10:28 PM

You can return an empty shape result.

Display is what you can use to display a shape. It looks simple and it is, really.