Show placeholders in case they’re not present in the scope #311
Unanswered
d4vsanchez
asked this question in
Q&A
Replies: 1 comment
-
I believe the default filter will do the trick: {{ user.name | default: 'nobody' }} In case you set |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
I've been working on a feature in which I need to make use of the features that LiquidJS provides (mainly the case/when operator) but in case there's no value in the scope of the selected message, I need to show the message.
For example, if the message inside the when operator have the following message:
You have chatted with {{user.name}}
and there is no { user: { name } } in the scope, I need to show the placeholder originally instead of LiquidJS converting it into a blank space character.I have tried doing an Object Proxy that evaluates to true in case any property is queried or passed to it, this way I can pass object as the scope variable, but it's not working correctly:
Do you know if there's a way to do this? Or if you could help me to understand which entity to look so I can better understand how's the scope handled in order to get the data from there.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions