Hyperlink/Picture Column does not display image

I came across a very interesting issue. I had a simple custom SharePoint List library. One of the columns was a “headshot” formatted as a Picture to allow users to paste in a URL of their pictures.

In a SharePoint list view, the picture came out wonderfully. However, I wanted to be a little creative in SharePoint Designer.

So I created my data view and dragged my columns onto the page.

 

The Headshot value turned out to be something like this on the page. “http://intranet-porta/headshots/uzma1.jpg,”

When formatting the “@Headshot” value as a picture link was broken. All images in the list turned out to have an extra “,” at the end of the URL.

The work around is to create a XSL attribute, in my example, I created:

<img>

<xsl:attribute name=”src”>

<xsl:value-of select=”substring-before(@Headshot,’,’)” />

</xsl:attribute>

</img>

And it works like magic!

Advertisements

Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: