This project is read-only.

Creating an Alternate Part of a Content Type by Zone

Topics: Customizing Orchard
Jan 25, 2012 at 9:37 PM

Hi all,

I'm having trouble customizing Orchard to allow me to specifically overwrite the parts of a content type by zone. I need to have multiple different views of certain parts of type professional, depending on what zone the widget is placed in.

For example,

  • ContentPart+ContentType+Zone
  • Fields.Common.Text-Professional-BeforeContent.cshtml and Fields.Common.Text-Professional-Content.cshtml

Is this possible? I've tried customizing the IShapeTableProvider, as seen on but to no avail. 

Any help would be greatly appreciated.

Jan 26, 2012 at 5:28 AM

Did you try Widget Alternates and Shape Tracing?

Jan 29, 2012 at 1:38 AM

Yeah I did. However, I don't get an option to create an alternative for a Content Part by Type and Zone. 

Eg :

Jan 31, 2012 at 5:13 AM

What happens when you try implementing a IShapeTableProvider? Another thing to try may be to override Zone rendering to add alternates to child shapes (which are your widgets) on the fly.

Sep 13, 2013 at 8:16 PM
dear bertrandleroy,
May you help to a small code to solve this case.
I mean __how to get the zone of part_content is displayed __ to assign a customize template to it.
            .OnDisplaying(displaying => {
                if (zone == "Navigation"){
                } else if (timezone = "content"){
                //How to get zone
Sep 13, 2013 at 9:47 PM
Look at how WidgetAlternatesFactory is doing it (that's in Orchard.DesignerTools module / Widget alternates feature).