I'm working on implementing a custom news excerpt list view for a site. It has 4 fields,
- Title
- Short Article
- URL to full article
- Image
Currently, I was successfully able to make it look right using 4 basic text fields in the list edit form, however, there is a feature in Sharepoint that allows the user to select a published image from the server using a built in browser. This image is then stored as html in the field "PublishingPageImage". I'm realizing, however, that any fields with html in them are getting returned as blank for some reason, and when I switched my basic URL text field over to the Published Image type, this is occurring. In addition, the link html no longer displays using Sharepoint's Hyperlink field type.
I've tried using a lot of suggested methods on the web, however, they have all been throwing errors on the web part for me.
Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
Correlation ID:ae8f04be-849f-454f-843a-d2f7487b31d8
Any suggestions to my code here would be appreciated, I'm fairly new to the world of xsl. Sharepoint Designer appears to show no problems with the xsl.
<!--
This section is the set up and can be used at the top of any external XSLT stylesheet file
-->
<xsl:stylesheet
xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
version="1.0"
exclude-result-prefixes="xsl msxsl ddwrt"
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:SharePoint="Microsoft.SharePoint.WebControls"
xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>
<!--
End of Set Up
-->
<!--
The initial template which in this case is matching everything with "/"
It then creates a variable called Rows - this is accessed as $Rows
A standard HTML table and header row with the names of our columns is next followed by a loop through each row of the list and calls our second template dvt1-rowview to display the contents
-->
<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema">
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
<link rel="stylesheet" type="text/css" href="/Transportation/Styles/styles.css" />
<ul class="section-list">
<xsl:for-each select="$Rows">
<xsl:call-template name="dvt_1.rowview" />
</xsl:for-each>
</ul>
</xsl:template>
<!--
End of first template
-->
<!--
Standard HTML rows and cells contain the contents of our list row
xsl:value-of command is used to display our columns
Columns are accessed as @InternalColumnName
-->
<xsl:template name="dvt_1.rowview">
<li>
<xsl:if test="@PublishingPageImage != ''">
<xsl:value-of select="@PublishingPageImage" disable-output-escaping="yes"/>
</xsl:if>
<h3><xsl:value-of select="@Title" /></h3>
<p><xsl:value-of select="@Short_Content"/></p>
<p><xsl:value-of select="@Link" disable-output-escaping="yes"/></p>
</li>
</xsl:template>
</xsl:stylesheet>