在哪里为共享点列表添加禁用输出转义?

Gre*_*ers 5 xslt sharepoint sharepoint-designer sharepoint-online

是的,我知道这是重复的,但是其他答案现在已经过时了。我将SharePoint Online与SharePoint Designer 2013一起使用。

我想为SharePoint列表视图设置disable-output-escaping = yes。

这是我尝试过的:

  • 我将字段类型设置为数字。这适用于旧版本的SharePoint,但不再适用于在线SharePoint。
  • 我尝试在SharePoint Designer中打开它的设计视图,但在SharePoint Designer 2013中不再存在
  • 我尝试设置自定义XSL,但这只会导致错误。在哪里添加XSL以使其正常工作?本身引用main.xsl。如果我知道该文件在哪里,则可以将其复制为创建自己的XSL的起点,但是在站点的任何地方都找不到。

这是我对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>
Run Code Online (Sandbox Code Playgroud)

小智 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
}  
Run Code Online (Sandbox Code Playgroud)