Expand my Community achievements bar.

SOLVED

i18n - how to pass variable and html code in message

Avatar

Level 1

So I need to do something like:
Here is my message with inner_variable, ok.

inner_variable gonna be set in js and I need styles for it.

I tried something like:

.html

${'message' @ i18n, format='<span class="email-address__text"></span>'}

.xml

sling:message="Here is my message with {0}, ok."

But the span works like text and I can't set any values. Any suggestions?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Where are you defining the variable in {}.

THis does not look right. IN HTL - normally these objects are set on Java backend (ie - sling models) or JS USE API.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Where are you defining the variable in {}.

THis does not look right. IN HTL - normally these objects are set on Java backend (ie - sling models) or JS USE API.