I have altered the javascript of a template load event. This has been saved correctly, but the changes have not rippled through to the pages which are dependendent on that template.
Any ideas
I have altered the javascript of a template load event. This has been saved correctly, but the changes have not rippled through to the pages which are dependendent on that template.
Any ideas
Hello Terry,
Could you, please share the altered javascript with us?
Thank you!
mainTemplate load event:
pre//this indicates how complete aprofile is:
//There are 20 profile items, so for every completed item
//we add 5%. This is than saved in the lititem counter value
var profileCompleteness = 0, key;
for (key in Apperyio.storage.trader.get()) {
//console.log("key = ", key);
if (Apperyio.storage.trader.get("$['" + key + "']") !== "") {
profileCompleteness += 5;
}
}
$("span.ui-li-count").text(profileCompleteness.toString() + "%");
/pre
This is the base template for most of my pages, I had a console.log in there in the for loop which I have commented out. It was beginning to get annoying as it kept filling my console every time a page was opened.
Sample script from one of the dependent pages:
pre//this indicates how complete aprofile is:
//There are 20 profile items, so for every completed item
//we add 5%. This is than saved in the lititem counter value
var profileCompleteness = 0, key;
for (key in Apperyio.storage.trader.get()) {
console.log("key = ", key);
if (Apperyio.storage.trader.get("$['" + key + "']") !== "") {
profileCompleteness += 5;
}
}
$("span.ui-li-count").text(profileCompleteness.toString() + "%");/pre
As you can see, it is the same code, but the console.log has not been commented out. This is the same for all the dependent pages. The idea of a template is change the template to change all its dependents.
Any update on this?
Hello Terry,
We are very sorry, but this is something outside the scope (https://docs.appery.io/docs/general-s...) of our standard support.
Could you clarify, what exactly doesn't work there?
The Problem is with the app builder itself.
If you make a change on a template then isn't it supposed to update the pages built from that template? If not what is the point of having templates?
I have made changes to the javascript template load event, but the changes are not seen in the dependent pages.
Hello Terry -
Thank you for pointing out this issue -- I have reported this to our development team.
Because you are using on Load event in your template and the pages names are different on different pages it runs the actual on page load event on a specific page and takes your on load event from your template.
As a workaround you can delete the unneeded Load events on your pages.
Thanks Illya