More in this section

Forums / Developing with Sitefinity / ImageSelector with Relative URL

ImageSelector with Relative URL

2 posts, 0 answered
  1. Kunal Johar
    Kunal Johar avatar
    8 posts
    22 Jan 2010
    26 Feb 2012
    Link to this post

    I ran into the "important note" on this issue:

    Important Note: the value persisted in string mode is the full url to the image, including the host name. So if you are working in a development or staging environment, you might get a url that begins with http://localhost. Be sure to update your widget properties when deploying to production.

    The rest of the setup for ImageField is similar to PageField, so it is omitted here. Please take a look at the sample project below for the complete implementation.

    My question is is there any suggested code based work around so that we can store the relative image path instead of the full image path?  Also is there a suggested SQL find/replace script I can run to fix this when moving from dev to production with already chosen content?
  2. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    24 Sep 2012
    29 Feb 2012
    Link to this post
    Hi Kunal,

     Actually you can modify the saved value in the getValue method of the image field's script part (but that would be hacking of the default ImageField). An easier approach would be to use Slavo's Thumbnail selector, which saves guids in the database (rather than links) and is a lot better for this case than the ImageField. Here's you can find the image selector : 

    Svetoslav Petsov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested 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, 0 answered