0
votes

I've read the various questions regarding this but couldn't not make any any progress. I'm new to Orchard so maybe I'm doing something incorrectly.

The goal is to show a "featured" image for each post in the Blog Home Page (Summary).

The first thing I did was to add a new content type for Image Gallery, following the directions at the link: http://docs.orchardproject.net/Documentation/Creating-an-image-gallery

Then I edited the Blog Post Content Definition, adding the new content type Media Library Picker Field that I created in step 1.

Now on each post there is the ability to Add a new Image.

Now I want that selected image to show up on the Blog Summary view & in the individual Blog Post view.

I followed the direction at the link below, by adding the new element - to the placement info file in my theme. Image not appearing from a Content Part with a Media Picker Field

Still no luck...what I am missing here???

Thanks for the input

1
This is not possible to add created content type to Blog Post Content Type. May be you added standard Media Library Picker Field to Blog Post Content Type?Alexander Petryakov
@AlexanderPetryakov: I got it figured out, had typo in my placement.info file. But then the Media Picker field name and related image were showing up along with the actual image. I added this to the placement.info file of my theme to override showing the Media Title and related info. <Match ContentType="Image"> <Place Parts_Common_Metadata_Summary="-"/> <Place Parts_Common_Metadata="-"/> <Place Parts_Title_Summary="-"/> <Place Parts_DisplayName_Summary="-"/> </Match>Mike Anderson
Now I just need to figure out how to override the content template. Currently when I view blog post, the post text is shown FIRST and then the Media image is shown. I want to reverse that... imgur.com/LCCwoQPMike Anderson
You can do it the same way. You need change position of shapes inside of Blog Post Content Type. Edit placement.info <Match ContentType="BlogPost"><Match DisplayType="Detail"><Place Fields_MediaLibraryPicker="Content:1" Parts_Common_Body="Content:2" /></Match></Match>Alexander Petryakov
Thanks, I will try that out, it's a bit of learning curve, but I"m seeing that Orchard has tons of potential! My final goal is to actually "embed" the blog into my current MVC website...not sure if I will do it using the RSS feeds or maybe I can talk directly w/ the orchard db.Mike Anderson

1 Answers

4
votes

Just add a MediaLibraryPickerField directly to the BlogPost Content Type. That's it.

You don't need anything else (no "Image Gallery Content Type" - that would indeed be another Content Type).

The Display Name for the field can be "Featured Image".

The MediaLibraryPickerField can be configured to not allow multiple content items (allow only one).

placement.info will allow you to decide where you want the field to show, and you already know.

Shape Alternates will allow you to modify the "template", for both Summary and Detail views, if needed.