Hi @Norm and fellow developers,
I created a bric which uses some template values, and everything is working except for when there are multiple instances of the bric on the same page. As per the documentation I set the json values, in the template section as follows:
{"attr":"my-attr","value":"Hello World","template":"custom-bric.css","force-newfile":"yes"}
Then in using the storeCustomBricTemplateVal
function I pass the new values to the template as follows:
window.webkit.messageHandlers.storeCustomBricTemplateVal.postMessage('{"attr":"my-attr","value":"New World","template":"custom-bric.css","force-newfile":"yes"}');
window.webkit.messageHandlers.sync.postMessage("changes");
When using 2 of the brics in question on the same page, Blocs correctly creates 2 templates, and I see them in the exported files:
custom-bric.css
and
custom-bric-1.css
The issue is that both templates have the same values even thought the values are different in the UI, one should have the value “New world” and the other “Hello world”, the value of the attribute(s) of the first bric on the page populates both CSS files above.
So is this a bug, and should I file a bug report, or am I doing something incorrectly?
Thanks in advance.
PS info: actually even with only 1 bric on the page, Blocs still creates the two CSS files mentioned above when the "force-new file":"yes"
setting.