【问题标题】:How do I tie my liquid script to the HTML file?如何将我的液体脚本绑定到 HTML 文件?
【发布时间】:2019-08-29 03:17:01
【问题描述】:

我提出了一个挑战,我应该使用 Liquid 将我的 html 文件的属性更改为另一个,我编写了函数的逻辑,但我无法将它与我当前的 html“链接”。它与配置相关还是我错过了什么?这是我第一次使用液体或任何与 ruby​​ 相关的代码。

这里是sn-p的代码:

{{% if custom_attribute.${loyalty.has_account} == false %}
{% capture destinationUrl %}https://www.thirdlove.com/account/register {% endcapture %}
{% capture buttonText %}Sing up Now{% endcapture %}
{% else %}
{% capture destinationUrl %} https://www.thirdlove.com/account/login{% endcapture %}
{% capture buttonText %}Sing in Now{% endcapture %}
{% endif %}} <a href="{{destinationUrl}}">{{buttonText}}</a>

【问题讨论】:

    标签: ruby email liquid


    【解决方案1】:

    不确定您要实现什么目标,但由于 Liquid 是一种服务器端渲染语言,您将无法根据用户与它的交互来修改 HTML。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-27
      • 1970-01-01
      • 1970-01-01
      • 2015-06-26
      • 1970-01-01
      • 2011-06-12
      相关资源
      最近更新 更多