More in this section

Forums / Developing with Sitefinity / Links break on rename in Library

Links break on rename in Library

2 posts, 1 answered
  1. bemara57
    bemara57 avatar
    135 posts
    27 Mar 2008
    17 Mar 2010
    Link to this post
    When renaming image in the library, they break the links on the frontend. Shouldn't they work like how pages work (guid reference)? Something like this in the HTML:

    <img src="" alt="My Image Name" />

    That way, you can rearrange the library as many times as you wish. Any suggestions on where to look to get this done? I don't mind if I have to create a mod for it... it's just that it can just break many images on a site in an instant.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    17 Mar 2010
    Link to this post
    Hi bemara57,

    The built-in controls resolve the path internally and you should not have problems with this.In controls like GenericContent, Sitefinity Image we use Telerik.Cms.Web.LinkParser that gets sfref attribute ( which format is [Provider]ID) of the item and then resolve the correct path.

    <img alt="" style="width: 200px; height: 200px;" src="/Libraries/libraryName/Desert.sflb.ashx" sfref="[Libraries]f19bb7aa-2d78-46ca-b197-de2907efe0d2" />

    We had similar problems with versions before 3.7 SP2 ( there is SP3 available now).

    In case you have a custom control you need to get the parent of your IContent item. The parent is actually the library (ILibrary), so you can get the correct library name.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 1 answered