I have a Image Media Picker and Multiple Image Media Picker in that order on a document type. In the back office im able to pick images and it appears to work fine.
In browser the images are not displayed and instead the following to lines are:
Thanks guys, i ahd indeed made a silly assumption that it was an automatic html generating method or partial view etc.. like other blocks.
I kept getting errors witht "MediaWithCrops" type. I found "IPublishedContent" from another post that worked. I also found the images variable declaration only behaved in a @{} codeblock.
Media picker doesn't generate html
I have a Image Media Picker and Multiple Image Media Picker in that order on a document type. In the back office im able to pick images and it appears to work fine.
In browser the images are not displayed and instead the following to lines are:
Images within rich text fields do seem to display fine.
what does your html look like in your view where you are trying to display the image? You should be able to get the media/image like this:
If it's a multi picker you need to cast to IEnumerable
Instead of MediaUrl() you can also use GetCropUrl() to return better compressed and optimized images.
The media picker does not generate HTML, it will provide data for you to make your own HTML. See @Huw Reddicks post for an example.
Thanks guys, i ahd indeed made a silly assumption that it was an automatic html generating method or partial view etc.. like other blocks.
I kept getting errors witht "MediaWithCrops" type. I found "IPublishedContent" from another post that worked. I also found the images variable declaration only behaved in a @{} codeblock.
my final code for future googlers:
}
is working on a reply...