More in this section

Forums / Developing with Sitefinity / Getting Image URL using GetValue

Getting Image URL using GetValue

2 posts, 0 answered
  1. Gary
    Gary avatar
    28 posts
    16 May 2012
    17 Oct 2013
    Link to this post

    How can I get the URL of an image using a custom widget?

    I can get all the text field values by using:

    But, not sure how I can get an image URL.


  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    18 Jul 2012
    17 Oct 2013
    Link to this post
    is image the Image model from the Images module in Sitefinity? All MediaContent items have a ItemDefaulUrl property as well as a MediaUrl and even ThumbnailUrl that you can use to access these properties directly.

    If instead you're trying to get a Custom Field of type Media (image) this value is actually stored a s a GUID LINK to the image, not the image itself. I don't know if this has been improved in the recent release but if not you have to manually use this to get the media url from the guid.

    There's more information and an example of this here: Retrieving Data From Dynamic Modules Using the Module Builder API

    I hope this is helpful, let me know if I've misunderstood your question

2 posts, 0 answered