More in this section
Forums / Developing with Sitefinity / change in sfref value causes to image to fail?

change in sfref value causes to image to fail?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Will
    Will avatar
    1 posts
    15 Apr 2011
    15 Apr 2011
    Link to this post
    I had an image in a resource that was displaying fine - it had a sfref value that seemed to be a hexadecimal code:

    something like :
    <img src="/assets/soletrader/libraries/general/myimage.png" sfref="[Libraries] 12345ABCD-1234AD" href="/imagelink" alt="imagealttext" title="imagetooltip" />

    this then changed to
    <img src="/assets/soletrader/libraries/general/myimage.png" sfref="~/assets/soletrader/libraries/general/myimage.png" href="/imagelink" alt="imagealttext" title="imagetooltip" />

    the image then failed to show properly.
    I have fixed this by changing the src value to "" and by deleting the sfref. [we are an ecommerce site and have some https sections, hence the src="https://..."]
    what is sfref, and why does sitefinity add it?
    Am I right that the value has changed from hexadecimal to "~/..."?
    Was it this change that caused the image to fail to show?

    How do I stop this reoccuring for other images in resources?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    18 Apr 2011
    Link to this post
    Hi Will,

    sfref is an attribute that we use to resolve dynamic links. Its value is [Provider]Guid - this shows the data provider and the item ID. When the content is saved or edited we call LinkParser.ResoveLinks and pass the entire HTML of the content item. We check for this attribute and its value. Then we set the proper href if the item is found.Generally you should not change the sfref, otherwise the item url will not be resolved properly and when you rename the content item( image, document etc) this will break the link.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

2 posts, 0 answered