Samples/Branding.ClientSideRendering/Branding.ClientSideRenderingWeb/Scripts/JSLink-Samples/ConfidentialDocuments.js
// This function provides the rendering logic
This function provides the rendering logic
This function provides the rendering logic
function linkFilenameFiledTemplate(ctx) {
    var confidential = ctx.CurrentItem["Confidential"];
    var title = ctx.CurrentItem["FileLeafRef"];
    title = title.replace(/\.[^/.]+$/, "")
    if (confidential && confidential.toLowerCase() == 'yes') {       
        return title + "&nbsp;<img src= '" + _spPageContextInfo.siteServerRelativeUrl + "/Style%20Library/JSLink-Samples/imgs/Confidential.png' alt='Confidential Document' title='Confidential Document'/>";
    }
    else
    {
        return title;
    }
}
function linkFilenameFiledTemplate ( ctx ) { var confidential = ctx . CurrentItem [ "Confidential" ] ; var title = ctx . CurrentItem [ "FileLeafRef" ] ; title = title . replace ( / \.[^/.]+$ / , "" ) if ( confidential && confidential . toLowerCase ( ) == 'yes' ) { return title + "&nbsp;<img src= '" + _spPageContextInfo . siteServerRelativeUrl + "/Style%20Library/JSLink-Samples/imgs/Confidential.png' alt='Confidential Document' title='Confidential Document'/>" ; } else { return title ; } }
This function provides the rendering logic
This function provides the rendering logic
// This Regex expression use to delete extension (.docx, .pdf ...) form the file name // Check confidential field value // Render HTML that contains the file name and the confidential icon