Skip to content

Instantly share code, notes, and snippets.

@MatthewLHolden
MatthewLHolden / .less
Created November 22, 2016 08:31
JSLink - Responsive Document WP
body {
background:#f5f5f5;
}
.ms-Grid {
max-width:1280px;
margin:0 auto 0;
}
.myDocuments {
width:100%;
@MatthewLHolden
MatthewLHolden / aspx
Created November 22, 2016 08:25
JSLink - Responsive Document WP
<div class="ms-Grid">
<div class="ms-Grid-row">
<div class="ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg12">
<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="wpz1_top" Title="Top" FrameType="TitleBarOnly" Orientation="Vertical"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</div>
</div>
</div>
@MatthewLHolden
MatthewLHolden / .js
Last active November 22, 2016 08:28
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">';