November Happy Hour will be moved to Thursday December 5th.

Image not showing in editor mode

Vote:
 

I’m having a few issues with images not appearing in the editor, and was hoping if someone could point me in the right direction.

I have an image within a block:

        [UIHint(UIHint.MediaFile)]

        [CultureSpecific]

        [Display(Name = "Background", Description = "The background image")]

        public virtual ContentReference BackgroundImage { get; set; }

Then I reference the image in my view:

When in editor mode, the image does not show. However, when selecting “Visit on webpage” the image loads fine.

The correct URL seems to be:

/globalassets/x.jpg

But the editor mode it is:

/EPiServer/CMS/Content/globalassets/en/x.jpg,,1011?epieditmode=False

Any help would be much appreciated.

Many thanks,

Peter.

#115069
Jan 08, 2015 19:15
Vote:
 

I believe this issue was resolved in a later version of 7.5. I'm not sure which update fixed this, but I recall this issue was fixed in an update a few months back. So updating to latest should resolve this - unless, of course, you're already on latest :).

#115072
Jan 09, 2015 0:24
Vote:
 

Thanks for your reply Richly.

Unfortunately, updating to the latest versions has made no difference.

#115110
Jan 09, 2015 11:58
Vote:
 

You can render the image like this:

UrlResolver.Current.GetUrl(SomeContentReference, null, new VirtualPathArguments() { ContextMode = ContextMode.Default });

This will force the same behavior in edit mode as in view mode

#115128
Jan 09, 2015 15:02
Vote:
 

Perfect! Many thanks Per.

#115132
Jan 09, 2015 15:27
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.