Keep variables in the html on save
Showing
1 changed file
with
9 additions
and
1 deletions
... | @@ -287,7 +287,15 @@ along with this software (see the LICENSE.md file). If not, see | ... | @@ -287,7 +287,15 @@ along with this software (see the LICENSE.md file). If not, see |
287 | <if condition="!htmlFile || htmlFile.parent?.location != grapesJsResource.location"> | 287 | <if condition="!htmlFile || htmlFile.parent?.location != grapesJsResource.location"> |
288 | <return error="true" message="Resource not found"/> | 288 | <return error="true" message="Resource not found"/> |
289 | </if> | 289 | </if> |
290 | <script><![CDATA[htmlFile.putText(html)]]></script> | 290 | <set field="htmlOut" from="null"/> |
291 | <script><![CDATA[ | ||
292 | if (context.replaceMoquiVarRegexPattern) { | ||
293 | context.htmlOut = html.replaceAll(context.replaceMoquiVarRegexPattern) { match -> | ||
294 | def output = moquiVars.find { it.value == match }?.key | ||
295 | return '${' + output + '}' | ||
296 | } | ||
297 | } | ||
298 | htmlFile.putText(htmlOut)]]></script> | ||
291 | <set field="htmlVersionName" from="htmlFile?.getCurrentVersion()?.getVersionName()"/> | 299 | <set field="htmlVersionName" from="htmlFile?.getCurrentVersion()?.getVersionName()"/> |
292 | <if condition="publish"> | 300 | <if condition="publish"> |
293 | <service-call name="update#moqui.basic.email.EmailTemplate" in-map="[emailTemplateId:emailTemplateId, | 301 | <service-call name="update#moqui.basic.email.EmailTemplate" in-map="[emailTemplateId:emailTemplateId, | ... | ... |
-
Please register or sign in to post a comment