-
-
Save MatthewLHolden/145074ab17fc0ed661ea9959f0363120 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function itemTemplate(ctx) { | |
var title = ctx.CurrentItem.Title; | |
var fileRef = ctx.CurrentItem.FileRef; | |
var url = _spPageContextInfo.webAbsoluteUrl + "/Documents/" + fileRef; | |
var html = ""; | |
html += '<li class="myDocuments__li ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg6 ms-u-xl3" >'; | |
html += ' <a href="' + url + '" class="myDocuments__link">'; | |
html += ' <span class="myDocuments__icon ms-Icon"></span>'; | |
html += ' <p class="myDocuments__text ms-font-l ms-fontColor-neutralPrimaryAlt ms-fontWeight-semilight">' + title + '</p>'; | |
html += ' </a>'; | |
html += '</li>'; | |
return html; | |
} | |
(function () { | |
var overrideCtx = {}; | |
overrideCtx.Templates = {}; | |
overrideCtx.Templates.Header = "<ul class=\"myDocuments\">"; | |
overrideCtx.Templates.Item = itemTemplate; | |
overrideCtx.Templates.Footer = "</ul>"; | |
//overrideCtx.BaseViewID = 1; | |
//overrideCtx.ListTemplateType = 100; | |
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment