是的,我知道这是重复的,但是其他答案现在已经过时了。我正在将SharePoint Online与SharePoint Designer 2013一起使用。
我想为SharePoint列表视图设置disable-output-escaping = yes。
这是我尝试过的:
以下是我与aspx相关的部分:
<FieldRef Name="After_x0020_Mitigation"/></ViewFields>
<RowLimit Paged="TRUE">100</RowLimit><Aggregations Value="Off"/
<JSLink>clienttemplates.js</JSLink><XslLink default="TRUE">Main.xsl</XslLink>
答案 0 :(得分:0)
我不知道在哪里放置“ disable-output-escaping = yes”,我找不到该信息。
但是,您可以使用字段模板来实现此结果。像这样的东西
(function () {
// Create an object that have the context information about the fields that we want to change the rendering of.
var nameFiledContext = {};
nameFiledContext.Templates = {};
nameFiledContext.Templates.Fields = {
// Apply the new hyperlink HTML Rendering to the field in your view. Swap out "<Your Field Name>" for your field name
"<Your Field Name>": { "View": nameFiledTemplate }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(nameFiledContext);
})();
// This function applies the rendering logic
function nameFiledTemplate(ctx) {
var name = ctx.CurrentItem.ID; //Swap out name variable for whatever field contains your hyperlink name
return "<a target='_blank' href='<Your Hyperlink Here>'>"
+ name + "</a>"; //Put the url for your hyperlink in the href above
}
答案 1 :(得分:0)
在XSL中,应该是这样的:
<xsl:value-of disable-output-escaping="yes" select="ddwrt:AutoNewLine(string(@Notes))" ddwrt:nbsp-preserve="yes"/>
如果在xslt中,则类似于以下内容:
<tr>
<td width="190px" valign="top" class="ms-formlabel" >
<H3 class="ms-standardheader">|
<nobr>Region< /nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@Region" disable-output-escaping="yes" />
</td>
</tr>