Closed QuietSpecialist closed 5 years ago
You'll need a good Knockout knowledge and a lot of studying of Mosaico code to grasp this kind of stuff: why do you need this answer? Maybe you don't need to know that.
That said:
1) The templates are combined to a js file by grunt: https://github.com/voidlabs/mosaico/blob/master/tasks/combineKOTemplates.js This will call "templateSystem.addTemplate" for each template in that folder.
2) The templates are then included by Knockout using a directive that uses a template (ko template:, ko block:): you find most of them in the parser: https://github.com/voidlabs/mosaico/blob/master/src/js/converter/parser.js
3) The template file name is "template name"-"templateMode".tmpl.html: so a single template "name" may have different representation depending on the "templateMode": "wysiwyg" is the template used in the main working area of mosaico where you edit the template visually. "show" is the template used to render the same template in preview or for export. "edit" is the templateMode for the "Content" tab and "styler" is the templateMode for the "Style" tab for that element.
Thanks for the detailed explanation Bago. I'm updating the front-end UI but want to avoid overwriting your template files, rather I'm just swapping them out for my versions. This was the only template file I couldn't find being referenced in the code.
Thanks again,
S
Hi,
I'm struggling to understand how/when 'blocks-wysiwyg.tmpl.html' get's loaded. Where in the app is the code that does this please?
Thanks,
S