Problem
I have two custom lists with ListTemplateType = 100
. When I insert the two on a page the last overwrites the first one, then it stops working, only the last one works.
I tried to add BaseViewID
with different ID's to both, as I saw in this question . But now neither template is working. Before only the latter did not display anything, now both are displaying the default Sharepoint listing.
Template 1 app1-jslink.js
;(function(){
overrideCtx.Templates.Header = "<div id='gallery-cardapio'>"+
"<div class='gallery-cardapio'>"+
"<ul class='thumbs'>";
overrideCtx.Templates.Footer = CustomFooter;
overrideCtx.BaseViewID = 1000;
overrideCtx.ListTemplateType = 100;
overrideCtx.Templates.Item = CustomItem;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
function CustomItem(ctx){...}
function CustomFooter(ctx){...}
})();
Template 2 app2-jslink.js
;(function(){
overrideCtx.Templates.Header = "<div id='gallery-niver'>"+
"<div class='gallery-container'>"+
"<ul class='thumbs'>";
overrideCtx.Templates.Footer = CustomFooter;
overrideCtx.BaseViewID = 900;
overrideCtx.ListTemplateType = 100;
overrideCtx.Templates.Item = CustomItem;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
function CustomItem(ctx){...}
function CustomFooter(ctx){...}
})();
Testing
If I put BaseViewId
in only one, both templates will be rendered with override that does not have BaseViewId
.
If I put BaseViewId
in both, they will be rendered with the default Sharepoint listing template.
If I do not set BaseViewId
to none, both will be rendered with the last override .