I'm writing a theme, where I want to use different shape/view for a widget type depending on what zone the widget are displayed in.
An example is, when the Menu widget is displayed in the zone "Navigation", I want it to use the view named "Navigation.Menu.cshtml". When the Menu widget is displayed in the left aside in my theme (zone: LeftAside), I want it to use the
view named "LeftAside.Menu.cshtml".
First, I thought it could be done by shape names as mentioned above, but I've tried it and it didn't work. I've also tried shape-tracing, but without any hints on how this can be achieved. I've read
http://docs.orchardproject.net/Documentation/Alternates and there is some hints about settings alternates through the placement.info, but I'm not quite sure how to do it zone-based,
or if this is even possible.
My guess would be something like:
<Place Parts_MenuItems="Header:after;Alternate=MenuItem" />
<Place Parts_MenuItems="Header:after;Wrapper=LeftAsideMenu;Alternate=LeftAsideMenuItem" />
But this doesn't seem to work.
I thought about checking from within the view, what zone it is being displayed in, and then change the alternates on the model directly, but I'm unsure about how to check the current zone from within the view.
Does anyone have any hints about how I could do this? :-)