Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rendering template for SharePoint Blogs
(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
You can’t perform that action at this time.