Skip to content

Instantly share code, notes, and snippets.

@arjancornelissen
Last active January 3, 2016 21:30
Show Gist options
  • Save arjancornelissen/1ddfe597f984493d1068 to your computer and use it in GitHub Desktop.
Save arjancornelissen/1ddfe597f984493d1068 to your computer and use it in GitHub Desktop.
Blog CSR basics
Type.registerNamespace('Arjan');
Arjan.Demo = Arjan.Demo || {};
Arjan.Demo.Templates = Arjan.Demo.Templates || {};
Arjan.Demo.Functions = Arjan.Demo.Functions || {};
Arjan.Demo.Templates.Header = function (context) {
return"";
}
Arjan.Demo.Templates.Footer = function (context) {
return"";
}
Arjan.Demo.Templates.Item = function (context) {
return"";
}
Arjan.Demo.Templates.Group = function (context, group, groupId, listItem, listSchema, level, expand) {
return"";
}
Arjan.Demo.Functions.RegisterField = function () {
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(Arjan.Demo);
}
Arjan.Demo.Functions.MdsRegisterField = function () {
var thisUrl = _spPageContextInfo.siteServerRelativeUrl + "style library/faq.js";
Arjan.Demo.Functions.RegisterField();
RegisterModuleInit(thisUrl, Arjan.Demo.Functions.RegisterField);
}
if (typeof _spPageContextInfo != "undefined" && _spPageContextInfo != null) {
Arjan.Demo.Functions.MdsRegisterField();
} else {
Arjan.Demo.Functions.RegisterField();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment