Customizing a view for a widget

Topics: Customizing Orchard
Jul 7, 2011 at 3:26 PM

Hi There,

I have created a widget which is made up of a couple of content parts. When this view is rendered, the default shapes of the parts are rendered into the UI. Is there any way we can use an alternate view when the part is being rendered as part of a widget? Can the part driver find out whether the part is being rendered as part of a widget?

Any help would be greatly appretiated.

Regards.

Coordinator
Jul 7, 2011 at 7:59 PM

Yes, there are alternates that include the content type, which is the same as the widget type. For example: Parts.Common.Body-HtmlWidget.cshtml will override the template for the body part only for Html widgets. I highly recommend you install the shape tracing (part of the designer tools module) in order to discover these alternates.