I'm trying to display a phrase via javascript (that takes a parameter), but I don't see the substituted value:
my_phrase has the following in my phrases.xml file:
Unfortunately, I only see my_phrase rendered on the page.
If I add this to my template, then everything works, but is it necessary to redefine the phrase in the template as well?
my_phrase has the following in my phrases.xml file:
'{myParam} man'
XF.phrase("my_phrase",{"{myParam}":'weeee'})
Unfortunately, I only see my_phrase rendered on the page.
If I add this to my template, then everything works, but is it necessary to redefine the phrase in the template as well?
HTML:
<xf:js>
XF.extendObject(XF.phrases,
{
myParam: "{{phrase('my_phrase')}}"
}
</xf:js>
Last edited: