Last active
April 20, 2016 20:53
-
-
Save vgrem/8744426 to your computer and use it in GitHub Desktop.
Rendering template for SharePoint Blogs
This file contains 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 () { | |
function blogBodyRenderer(ctx) { | |
var item = ctx.CurrentItem; | |
return '<a href="' + ctx.listUrlDir + '/Post.aspx?ID=' + item.ID + '" class="ms-accentText">Read more...</a>'; | |
} | |
function registerBlogsRenderer() | |
{ | |
var blogContext = {}; | |
blogContext.Templates = {}; | |
blogContext.Templates.Fields = { | |
"Body": { | |
"View": blogBodyRenderer | |
} | |
}; | |
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(blogContext); | |
} | |
ExecuteOrDelayUntilScriptLoaded(registerBlogsRenderer, 'clienttemplates.js'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment