locked
Image URL in SharePoint 2010 RRS feed

  • Question

  • Hello all,

    Can we have any out of the box feature to create Image URL column ,so that it will display an image in the UI and I click on image ,it should be redirected to another page/url?

    Thanks


    Like Cricket

    Tuesday, February 19, 2013 11:51 AM

Answers

  • Save html in this field

    html = "<a href=\"" + url + "\" target=\"_blank\"><img alt=\"" + name + "\" height=\"100\" src=\"" + imgUrl + "\" /></a>&nbsp;"
    
    item[fieldName]=html;
    
    item.Update();

    Or write this html in ui


    • Edited by Andrey_S1 Thursday, February 21, 2013 7:25 AM
    • Marked as answer by Hemendra Agrawal Thursday, February 21, 2013 7:48 AM
    Thursday, February 21, 2013 7:16 AM
  • Hi,

     Please look at the below liks for more information.

    http://blogs.technet.com/b/meamcs/archive/2012/09/27/adding-a-publishing-image-field-to-a-sharepoint-2010-calendar-list.aspx


    Sekar - Our life is short, so help others to grow

    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

    • Proposed as answer by Prasath C Tuesday, February 19, 2013 12:48 PM
    • Unproposed as answer by Hemendra Agrawal Tuesday, February 19, 2013 1:25 PM
    • Proposed as answer by Prasath C Tuesday, February 19, 2013 5:19 PM
    • Marked as answer by Hemendra Agrawal Thursday, February 21, 2013 7:47 AM
    Tuesday, February 19, 2013 12:47 PM
  • Hi Andrey,

    Its a nice solution. Can we apply the same in calculated formula?


    Like Cricket

    • Marked as answer by h_user2016 Thursday, February 21, 2013 9:36 AM
    Thursday, February 21, 2013 9:03 AM

All replies

  • Look on "Multiline Text Column (RichText)"
    Tuesday, February 19, 2013 12:14 PM
  • You can take content editor web part, you can put the image in between anchor tag as shown below

    <a href='Your navigation URL'>image</a>


    Mark this post as answer if this resolves your issue.


    Everything about SQL Server | Experience inside SQL Server -Mohammad Nizamuddin

    Tuesday, February 19, 2013 12:15 PM
  • Hi Andrey,

    Could you please let me know how to do using Muti Line of text?

    Thanks


    Like Cricket

    Tuesday, February 19, 2013 12:36 PM
  • Hi Mohammad,

    I am asking to do inside the list not outside. Moreover its a list column

    Thanks


    Like Cricket

    Tuesday, February 19, 2013 12:39 PM
  • Hi,

     Please look at the below liks for more information.

    http://blogs.technet.com/b/meamcs/archive/2012/09/27/adding-a-publishing-image-field-to-a-sharepoint-2010-calendar-list.aspx


    Sekar - Our life is short, so help others to grow

    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

    • Proposed as answer by Prasath C Tuesday, February 19, 2013 12:48 PM
    • Unproposed as answer by Hemendra Agrawal Tuesday, February 19, 2013 1:25 PM
    • Proposed as answer by Prasath C Tuesday, February 19, 2013 5:19 PM
    • Marked as answer by Hemendra Agrawal Thursday, February 21, 2013 7:47 AM
    Tuesday, February 19, 2013 12:47 PM
  • Thanks Sekar for the reply

    But the given link is to create a "Hyperlink or Image" column not to create "Hyperlink and Image" column


    Like Cricket

    Tuesday, February 19, 2013 1:09 PM
  • Hi Sekar,

    Its my fault.The given link is working fine


    Like Cricket

    Tuesday, February 19, 2013 1:34 PM
  • Hello All,

    Can we create a custom column something like this

    https://lh5.googleusercontent.com/-P8e8yemPfM0/TixtuDcgynI/AAAAAAAADfg/oHTzKzRnpng/s800/new%252520item.jpg

    the one which we get from codeplex

    http://spimagehyperlink.codeplex.com/

    Thanks


    Like Cricket

    Tuesday, February 19, 2013 1:48 PM
  • Save html in this field

    html = "<a href=\"" + url + "\" target=\"_blank\"><img alt=\"" + name + "\" height=\"100\" src=\"" + imgUrl + "\" /></a>&nbsp;"
    
    item[fieldName]=html;
    
    item.Update();

    Or write this html in ui


    • Edited by Andrey_S1 Thursday, February 21, 2013 7:25 AM
    • Marked as answer by Hemendra Agrawal Thursday, February 21, 2013 7:48 AM
    Thursday, February 21, 2013 7:16 AM
  • Hi Andrey,

    Its a nice solution. Can we apply the same in calculated formula?


    Like Cricket

    • Marked as answer by h_user2016 Thursday, February 21, 2013 9:36 AM
    Thursday, February 21, 2013 9:03 AM
  • Finally I am happy that I got my full solution by myself.

    It is as follows

     

    1)No need of custom code, no need of content types

    2)No need of multiline of text

    3)no visual studio required

    4)Its out of the box only

    Using Calculated field ,the following is the formula

    ="<a href='"&[URL]&"' target='_blank'><img src='http://mysite/Shared%20Documents/siteIcon.png'></a>"

    here URL is your url field name

    and select datatype as any number, currency ,date and time


    Like Cricket

    Thursday, February 21, 2013 9:44 AM
  • Before I try these....I was wondering whether or not these suggestions will fill my need to provide a contributor of site content with the ability to type a website url (i.e. google) and have SharePoint auto generate an image of the site's home page. They would then use that auto generated image for enhancing content on their own site. I hope to eliminate the need for the site contributor to manually create images and maintain consistency of image sizes across the site.  Thanks!
    Thursday, May 23, 2013 3:35 PM