MediaReference and UIHint

Vote:
 

Hi, 

I'm having some trouble using UIHint for MediaReference without loosing the original edit functionality.

If I use

[UIHint("ResponsiveMedia")]

the custom display template is used when rendering, but the edit functionality reverts to the "click here to edit" button.

If I use

[UIHint("ResponsiveMedia", PresentationLayer.Website)]

the custom template is not used at all. What am I doing wrong here?

Some additional background info:
I'm working on a site where some of the images should be scaled down depending on screen resolution, while others should just render as normal. The latter case is implemented as described here. For the former case I have added an additional display template "ResponsiveMedia.cshtml", and want to use this template for the applicable MediaReferences by annotating them with the UIHint attribute.

Is there perhaps a better way to achieve what I want?

#113036
Nov 11, 2014 12:25
Vote:
 

Should add that the site uses EPiServer 7.5 and ImageVault 4.4

#113039
Nov 11, 2014 12:29
Vote:
 

Hi!

If you want to have the normal ui behavior for the edit you can specify the following uihints.

[UIHint("ResponsiveMedia")]
[UIHint("ivpropertymedia",PresentationLayer.Edit)]

                        
#113079
Edited, Nov 12, 2014 13:52
Vote:
 

Ah, that works. Cheers!

#113081
Nov 12, 2014 15:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.