
Hi,
Is there a way where we can have a functionality similar to String.Format in Liquid? Basically I have a Resource string something like this.
{0} has records : {1}
I need to replace {0} and {1} with dynamic values using liquid tags.
So far, I have tried following things but I end up getting errors.
1) added an assign variable and then use it on the label.
{% assign my_secret_string = resx['resource Name'] | replace: '{0}', displayName | replace: '{1}', hitCount %}
here both displayname and hitcount are liquid tags. I even tried adding flower brackets around them but it still doesn't work
2) added the liquid syntax directly to the html attribute "{%endraw%}{{ resx['resource Name'] | replace: '{0}', 'displayName' | replace: '{1}', 'hitCount' }}{%raw%}". Even this doesn't work
Any idea on how can we work around resource strings using liquid template?
Thanks
*This post is locked for comments
I have the same question (0)