This project is read-only.

Load projection widget from code

Topics: Customizing Orchard, General, Writing modules
Sep 12, 2012 at 8:38 AM


It is possible to render / display a wdiget from code?

I would like to be able to filter content using the projection widget and add it to the page from code (using @Display from my template or adding it by using an IShapeTableProvider for instance.

Can't figure out if and how this can be done?




Sep 12, 2012 at 5:32 PM

If it's a widget, the standard way to do that is to have a layer with a (possibly custom) rule that sets up the condition for rendering it.

Alternatively, it's easy to create a shape from code and send it to any zone:

Sep 12, 2012 at 7:55 PM

I'm not sure how to create a specific projecten widget as a shape (I read that blogpost btw). 

I figured it's not so much the widget I was after, but the queries, so I created an IShapeTableProvider and used the query and projectmanager from code to build my shape. works fine.