This project is read-only.

Widget rendering problem

Topics: Customizing Orchard, Writing modules
Jul 12, 2011 at 11: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 11:21 PM

By overriding Widget.Wrapper.cshtml in your theme.

Jul 14, 2011 at 11: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 15, 2011 at 12:06 AM

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 15, 2011 at 12:17 AM

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