Skip to content

Instantly share code, notes, and snippets.

Avatar

MatthewHolden MatthewLHolden

View GitHub Profile
@MatthewLHolden
MatthewLHolden / .less
Created Nov 22, 2016
JSLink - Responsive Document WP
View .less
body {
background:#f5f5f5;
}
.ms-Grid {
max-width:1280px;
margin:0 auto 0;
}
.myDocuments {
width:100%;
@MatthewLHolden
MatthewLHolden / aspx
Created Nov 22, 2016
JSLink - Responsive Document WP
View aspx
<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>
View .js
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">';
You can’t perform that action at this time.