0
votes

I am using MVC for sitecore 7.2 website, I have a rich html field called body and has links to other sitecore content items.

output HTML for the links is rendered something like this

http://mysite/mypage/~/~/link.aspx?_id=6D705F2DED874D21A1367CB0F4A2F58D&_z=z

I am trying to render actual URL of the content item.

I have tried this but not working for me.

@Html.Sitecore().Field("Body")

I have also tried this but it is getting render as plain text

@Editable(GlassItem, x => x.Body)

Do I need to so some configuration changes??

1
In you web.config or config patches check te value of <setting name="Media.MediaLinkPrefix" value=""/> default = empty means ~/ for Sitecore 7.2 - Jan Bluemink
yes it is empty but this settings is for media items only, has it got something to do with sitecore items? - Ali
Do you have the 'ExpandLinks' processor in the 'renderField' pipeline? I believe that one is responsible for resolving the links you mention. - RvanDalen
I did not add or remove any processor. - Ali
Not saying you did, but in general you try to exclude possibilities when solving problems. I'd recommend checking out /sitecore/admin/showconfig.aspx and see if the processor is present. - RvanDalen

1 Answers

0
votes

this worked for me.

@Html.Raw(Sitecore.Links.LinkManager.ExpandDynamicLinks(Sitecore.Context.Item.Fields["Body"].Value))