0
Problem
I have two custom lists with ListTemplateType = 100
. When I insert the two on a page the last one overwrites the first one, then it stops working, working only the last one.
I tried to add the BaseViewID
with different ID’s for both, as I saw in this question. However, now neither of the two templates is working. Before only the last showed nothing, 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 the BaseViewId
in just one, both of them templates will be rendered with the override who does not own the BaseViewId
.
If I put the BaseViewId
both of them will be rendered with the standard Sharepoint listing template.
If I don’t put BaseViewId
neither, both will be rendered with the last override.