使标签内的逻辑 {% Raw %}...{% Endraw %}
在shopify中。
我有一些代码包装在 {% raw %}...{% endraw %}
标签中,但我需要通过 if 在该标签内创建逻辑。它是这样的:
{% raw %}
...
{%- if any != 0 -%}...{%- endif -%}
...
{% endraw %}
但是这样逻辑代码就被转义了。 请告诉我如何在 {% raw %}...{% endraw %}
标记内创建逻辑。
感谢。
In shopify.
I have some of the code wrapped in a {% raw %}...{% endraw %}
tag, but I need to make logic through if inside that tag. It goes like this:
{% raw %}
...
{%- if any != 0 -%}...{%- endif -%}
...
{% endraw %}
But this way the logic code is escaped.
Please tell me how I can make the logic inside the {% raw %}...{% endraw %}
tags.
Thank.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能。
{% raw %}
标签的整体思想是忽略其中的任何流动代码,以防止与其他语言的语法冲突。如果你想执行任何代码,你必须将其写在原始标签之外。
或者简单地说:
You can't.
The whole idea of a
{% raw %}
tag is to ignore any liquid code inside of it to prevent syntax conflict with other languages.If you want to execute any code you have to write it outside the raw tag.
Or to say it simply: