Pinegrow with Auto Formatting Mustache Code

I’ve been shamelessly using Pinegrow with Mustache templating and so far have been getting away with it for the most part.

ONE caveat is the IF conditionals {{#xyz}} contitional code {{/xyz}}

When I save them, Pinegrow removes the " / " from the ending curly braces.
I turned off the Auto Format setting in Pinegrow, and this still removes those slashes.

Anyone know any tricks to getting this to save without messing with the handlebars syntax?

Would be happy to see capabilities for templating in the future.

Hi @mrSidX,
That is a pretty neat use case! I was wondering if you could provide an example project where you have an IF conditional that is being stripped.
Cheers,
Bob

It would ideal if Pinegrow doesn’t auto-correct tags to stay agnostic to frameworks/diff use-cases…

Another thing is the error message displayed in the code editor for tags in camelCase or PascalCase which really is not an error w.r.t HTML spec… Also, for such tags, the tree displays the tag totally in lowercase… would be ideal if Pinegrow can stay agnostic here, so that it could support frameworks where templates allow PascalCase or camelCase tags!

Here is a template example of what is happening…

Notice the elements with attributes containing mustache template code being changed:
<input type="checkbox" .... {{#privileges.edit_films}} checked {{ privileges.edit_films}}/>

Should look like this:
<input type="checkbox" .... {{#privileges.edit_films}} checked {{ /privileges.edit_films}}/>

Note that the looping of Arrays in {{#payload}} ~ {{/payload}} works well and saves correctly to file without being changed.

Perhaps if I restructure somehow I might be able to avoid auto formatting…
But this seems to only affect inside the element tags / attributes??

Not sure why, but in the html code editor, I see the code as it should be (after manually adding / to the closing conditional {{/ ... }} … But when I save this to a file, the file gets changed removing the / from the template within the attributes…

Here is a link to an example page made in Pinegrow that exhibits this issue:
https://github.com/mrSidX/pinegrow-demo-templating-scenario-1/blob/main/template.html

1 Like

Glad to see PG v6 doesn’t show error message for PascalCase and Camelcase tags in the new editor, probably it’s a monaco thingy… Thanks for this!

Would be good to get this also correct (preserve tag casing) in the Tree panel… @matjaz