【发布时间】: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>
【问题讨论】: