Placing my Media Library Picker Field

Topics: Troubleshooting, Writing themes
Jul 15, 2013 at 11:58 AM
I'm testing out the 1.x branch (which is currently at commit 1ad4526f4d84).

I added a Media Library Picker Field to the blog post content type. When I create a post with an image the image is below the comments.

When I look in the shape tracer, Fields_MediaLibraryPicker is contained in Parts_CommentForm.

That doesn't seem right. I tried changing the placement file to move it, but I couldn't get this to work.

This is what I tried:
<Match ContentType="Blog">
    <Place Parts_Image_Summary="Content:0"/>
</Match>
I also tried:
<Match ContentType="Blog">
    <Place Fields_MediaLibraryPicker="Content:0"/>
</Match>
Is there a correct placement that will fix this for me and is shape tracer reporting correctly?
Developer
Jul 15, 2013 at 12:47 PM
Put it on a BlogPost ContentType
<Match ContentType="BlogPost">
<Place Fields_MediaLibraryPicker="Content:0"/>
</Match>
Jul 15, 2013 at 2:22 PM
Thanks.
<Match ContentType="BlogPost">
    <Place Fields_MediaLibraryPicker="Content:0"/>
</Match>
That sorts it. I thought I'd tried that as well, but I didn't realise I'd typed Blog rather than BlogPost.
Aug 30, 2013 at 6:48 AM
I'm having an issue with placement of a MediaLibraryPickerField as well. I'm trying to hide a gallery field from a PortfolioPage content type in the admin, using following placement:
<Match ContentType="PortfolioPage">
      <Match DisplayType="SummaryAdmin">
        <Place Fields_MediaLibraryPicker_Gallery="-" />  
      </Match>
  </Match>
Can anyone guide me to the light please :)
Developer
Aug 30, 2013 at 8:40 AM
Have you looked into the file src\Orchard.Web\Modules\Orchard.MediaLibrary\Placement.info ?
 <Match DisplayType="SummaryAdmin">
    <Place Fields_MediaLibraryPicker_SummaryAdmin="Content:after"/>
  </Match>
Aug 30, 2013 at 9:32 AM
No, not really. But are you saying that I should change that placement.info rather than the one in my Theme?
Even when updating my Theme's placement.info to the following, it doesn't work:
<Match ContentType="PortfolioPage">
      <Match DisplayType="SummaryAdmin">
        <Place Fields_MediaLibraryPicker_SummaryAdmin="-"/>
      </Match>
  </Match> 
Developer
Aug 30, 2013 at 9:35 AM
No, it can only been changed in the placement.info in the TheAdmin theme or in the module Orchard.MediaLIbrary.
Aug 30, 2013 at 9:38 AM
Ok, changing it in TheAdmin theme does work, thanks!