I have a custom content part that is meant to be an image gallery. It has, right now, a gallery name (in the database) and a MediaLibraryPickerField. Here is the code from Migration.cs defining it:
table => table
typeof(ImageGalleryPart).Name, cfg => cfg.WithDescription("Image Gallery")
.WithField("Images", f => f
.WithSetting("MediaLibraryPickerFieldSettings.Hint", "Images to put in the image gallery.")
It's part of a content type that contains fields and data from a number of other parts. The problem I'm having is getting the two pieces of my ImageGalleryPart to render together when editing and when displaying.
They both render, but I'm not having any luck getting them to render together via placement. Here's my Placement file:
<Place Parts_ImageGallery="Content:5" />
<!-- Media Library Picker Field -->
Orchard finds my overriden view, and I am creating an ad-hoc zone to render the images to. Here's my view (minus the namespaces):
var imageGallery = (ImageGalleryPart)Model.Model;
<div style="width: 100%">
<div style="float: left;">
I can see that my view is being displayed and, sure enough, shape tracing is showing me that my ImageGalleryPart shape is rendering. But the MediaLibraryPickerField is rendering to the root Content shape and isn't behaving like it's part of my ImageGalleryPart
It doesn't seem to recognize my Placement override and instead uses the Placement.info from Orchard.MediaLibrary.
What am I missing?