Using the new costum placement feature in v.1.5

Topics: Customizing Orchard, Writing themes
Jul 18, 2012 at 10:51 AM

Hi, I am João and I'm starting to work with Orchard (currently at the latest version from the default branch from source control). 

I wanted a specific field (Fields_MediaPicker) from a specific content type to be shown on the Layout Featured zone of my theme. 
I came across this article: and I realised that I could do this in my theme's file: 
<Place Fields_MediaPicker="/Featured:1"/>

Now, my problem is the Fields_MediaPicker replaced the Zone [Featured], instead of being injected inside it. Is this the default behavior?
Because our featured zone has alternates and wrappers.
Is there any way to maintain the featured zone and not replace it?

Jul 18, 2012 at 8:43 PM

I've done a bit more digging on this issue, I believe this is to do with when the shape Featured is created.

With moving the part onto the zone in the, when the shape Featured is created it is not aware it should be Zone so is setting it's placement shapetype to ContentZone instead of Zone, thus not having the correct behaviour.

I tried to get around this, by forcing the shape type to be Zone in the like this

<Place Featured="shape=Zone"/>

But it didn't work, I also tried creating a custom shape table provider in the theme to set the behaviour as a zone, but it didn't work also:

public class FeaturedZoneShapeTableProvider : IShapeTableProvider
        public void Discover(ShapeTableBuilder builder)
                .OnCreating(creating => creating.Behaviors.Add(new ZoneHoldingBehavior(() => creating.New.Zone(), null)));

I may be missing something obvious, I'm still trying to get my head around clay, can anyone aid us on this?




Jul 23, 2012 at 12:23 PM

Please file a bug.

Jul 27, 2012 at 2:58 PM

Done, let me know if we're on the right track, and I'll be happy to try and sort it out if needed.