Widget rendering problem

Topics: Customizing Orchard, Writing modules
Jul 12, 2011 at 10:55 PM

I've built a contentpart and turned it into a widget. All works nice. I can't work out how to control the rendering of it correctly on the front end though. My driver has a Display method which is rendering my Parts_ContentPart shape but its obviously being wrapped. I searched on here and it seems that Widget.Wrapper is the culprit - how do I get complete control over the rendering of my widget?




Jul 13, 2011 at 10:21 PM

By overriding Widget.Wrapper.cshtml in your theme.

Jul 14, 2011 at 10:45 PM

sorry I know I'm asking lots of questions - we're hitting big deadlines on our project! thanks for all the help. 

how do you override it just for one widget type? If I override Widget.Wrapper  - all widgets get wrapped by my new wrapper.



Jul 14, 2011 at 11:06 PM

Yes, wrappers don't have alternates. You will have to either put some code in the wrapper template to distinguish them, or you can change the wrapper from placement info for certain matches.

Jul 14, 2011 at 11:17 PM

ok cool I've got it working with the standard Widget.Wrapper and an alternate for my Widget-MyPart