Also, if you are using UIHint.MediaFile for any media, you need some kind of logic to see what kind of media is added right?
Hi!
This is working on my local EPiServer 7.5 MVC-based site (though it has nothing to do with Web Forms or MVC). There was a change to this in one of the NUGET packages that came after the 7.5 release although I can't really see how that should affect you. Have you upgraded to the latest packages or if not, can you try and see if this solves your problem?
I updated framework and core from nuget, restarted visual studio and tried again with same problem. Is this what you mean by upgrade?
Also installed a new 7.5 MVC alloy site from depoyment center (not sure if this needs to be updated after installation) but it didn't work in this solution.
Try adding the latest version of the EPiServer.CMS.UI package to see if that helps since the change was done there.
Thanks Linus. Updated that package aswell. Had to manually delete some folders like CMS in Modules etc.
Great!
Hi Magnus,
Even i tried UIHint.MediaFile and UIHint.Video and both are working normal.
About my other question in this thread
"Also, if you are using UIHint.MediaFile for any media, you need some kind of logic to see what kind of media is added right?"
I tried to create two shared view under catalog DisplayTemplates called Media Video and Image. My idea was to render Video.cshtml view if you add a video to property with UIHint.MediaFile and Image.cshtml if an image is added. But it didn't work. Created a MediaFile.cshtml and then it worked. But now I need to add logic in this view to see what kind of media to render.
Any idea how to make this as clean as possible?
I have:
[UIHint(UIHint.MediaFile)]
[Display(Name = "AnyMedia", GroupName = SystemTabNames.Content, Order = 5)]
public virtual ContentReference AnyMediaReference { get; set; }
[UIHint(UIHint.Video)]
[Display(Name = "Video", GroupName = SystemTabNames.Content, Order = 4)]
public virtual ContentReference VideoReference { get; set; }
[ContentType(GUID = "85468104-E06F-47E5-A317-FC9B83D3CBA6")]
[MediaDescriptor(ExtensionString = "wmv,mp4")]
public class VideoFile : VideoData
{
public virtual string Description { get; set; }
}
Uploaded a mp4 file with success and when dragging it towards by two property I can only drag the file to "AnyMedia" not to "Video". I thought both would work.
Any idea how this work?