//Note how all siteComponents are created with layout, and responds to only two aggLayout-functions function PrivacyPage(layout){ this.layout = layout } PrivacyPage.prototype.setupFunction = function() { this.template = new ToggleFAQTemplate({ layout : this.layout, classPrefix: "privacy", showAll: 1, leadList : "ol" }) var dataHandler = new TemplateData({layout: this.layout, template: this.template, table: "privacy", isStatic: 1 }) dataHandler.fetchData() } PrivacyPage.prototype.layoutFunction = function(rootElement) { if (!rootElement) rootElement = this.layout.elements.rootElement; this.layout.layoutJSON(rootElement, this.template.templateJSON()) };