This project is read-only.

Media profile documentation

Topics: Core
Jul 18, 2013 at 11:45 PM
I assume that media profiles are important because they appear on the default admin menu in v1.7. However, I can't find any information about them in this forum, on StackOverflow, in the official documentation, books, or anywhere else. Can someone explain what a media profile is, what purpose it serves, and where I can find some examples of its use?
Jul 19, 2013 at 1:51 AM
They define a set of operations to run on media (watermarks, resizes, etc.), that you can then use in your templates as if they were plain images. It will take care of running all the processing operations, and then will cache the resulting media on disk.

Here's a couple of articles about it:
Jul 19, 2013 at 2:08 AM
Thank you very much for the explanation, Bertrand. I read David Hayden's blog posts earlier today, but David seemed to assume that the reader already knew what a media profile was.
Aug 23, 2013 at 7:55 PM
Is there anymore information on this? I've read quite a few of his blogs, but they don't explain exactly how to apply a media profile. Any help would be greatly appreciated.
Aug 23, 2013 at 8:02 PM
What a media profile is: a set of operations you will want to systematically apply to your media before displaying them on the site. That can include adding watermarks, standardizing size and format, etc.

How to apply a media profile: if you go to the edit screen for the profile, it will show you the form of the url to use in your templates to apply the profile. It looks like @Display.MediaUrl(Profile: "NameOfTheProfile", Path: TheRegularUrlOfThePicture)
Aug 23, 2013 at 8:23 PM
Yeah, I see that. That is razor for use in a .cshtml file.

I guess what I am asking is do I need to create a new view or part to use the profile?

Here is my scenario. I have created a new content type called "Portfolio" that has a "Image (Media Library Picker Field)" on it. This lets me select whatever images I want from the media library. How do I apply the Thumbnail media profile I created to this content type?

Aug 23, 2013 at 8:46 PM
You override the template.
Sep 13, 2013 at 5:58 PM
Hi Bertrand and everyone in this topic!

Bertrand... can you be more specific with your last indication in this thread: "... override the template". Do you mean he should create a cshtml for his new Content Type and apply the profile right there?

Sep 13, 2013 at 9:49 PM
Yes, well, except that the template to override is the template for the field, not for the content type. More precisely, an alternate for the field with a specific field name. See the documentation about alternate shapes for more details.
Sep 13, 2013 at 9:58 PM
Thanks again Bertrand.

So much to learn... so much!

I'll read this whole weekend :)