我工作的實施爲站點自定義新聞摘要列表視圖空白文本。它有4個領域,SharePoint 2010的XSL @PublishingPageImage是顯示列表Web部件
- 標題
- 短文章
- URL到整篇文章
- 圖片
目前,我是能夠成功地作出正確的使用4個基本的文本字段期待但是,在列表編輯表單中,Sharepoint中有一項功能允許用戶使用內置瀏覽器從服務器中選擇已發佈的圖像。然後,該圖像將作爲html存儲在「PublishingPageImage」字段中。然而我意識到的是,在他們的HTML的任何字段都被退回爲空白出於某種原因,當我打開我的基本URL文本字段到發佈的映像類型,這正在發生。另外,鏈接html不再使用Sharepoint的超鏈接字段類型顯示。
我已經使用了很多在網絡上建議的方法試過了,但是,他們都已經對我的Web部件引發錯誤。
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
任何意見,我的代碼在這裏將不勝感激,我是相當新的xsl的世界。 Sharepoint Designer似乎顯示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>
它仍然沒有加載任何圖像,我複製的例子和src的圖像是空的,這是很好的。 – roemhildtg
我想知道,有沒有設定我需要啓用允許發佈圖片附加到列表中? – roemhildtg