如何更改 Shopify 液体中的 title-Attribut?
How do I change the title-Attribut in Shopify's liquid?
谁能告诉我如何更改这里的 title-Attribut。
流码
<ul class="material-nav">
{% for tag in collection.all_tags %}
{% if current_tags contains tag %}
<li class="active">
{{ tag | capitalize | link_to_tag: tag }}
</li>
{% else %}
<li>
{{ tag | capitalize | link_to_tag: tag }}
</li>
{% endif %}
{% endfor %}
</ul>
输出
<ul class="material-nav">
<li>
<a title="Show products matching tag tag1" href="/collections/products/tag1">Tag1</a>
</li>
<li>
<a title="Show products matching tag tag2" href="/collections/products/tag2">Tag2</a>
</li>
<li>
<a title="Show products matching tag tag3" href="/collections/products/tag3">Tag3</a>
</li>
</ul>
我知道您可以按如下方式在普通 link 上编辑 link 标题:
{{ 'Foo Bar' | link_to: 'http://www.foobar.com', 'Foo Bar Title Here' }}
因此 可能 有理由认为您可以尝试以下操作:
{{ tag | capitalize | link_to_tag: tag, 'Title Here' }}
虽然没有承诺,我的朋友。我只建立了几个流动站点。
谁能告诉我如何更改这里的 title-Attribut。
流码
<ul class="material-nav">
{% for tag in collection.all_tags %}
{% if current_tags contains tag %}
<li class="active">
{{ tag | capitalize | link_to_tag: tag }}
</li>
{% else %}
<li>
{{ tag | capitalize | link_to_tag: tag }}
</li>
{% endif %}
{% endfor %}
</ul>
输出
<ul class="material-nav">
<li>
<a title="Show products matching tag tag1" href="/collections/products/tag1">Tag1</a>
</li>
<li>
<a title="Show products matching tag tag2" href="/collections/products/tag2">Tag2</a>
</li>
<li>
<a title="Show products matching tag tag3" href="/collections/products/tag3">Tag3</a>
</li>
</ul>
我知道您可以按如下方式在普通 link 上编辑 link 标题:
{{ 'Foo Bar' | link_to: 'http://www.foobar.com', 'Foo Bar Title Here' }}
因此 可能 有理由认为您可以尝试以下操作:
{{ tag | capitalize | link_to_tag: tag, 'Title Here' }}
虽然没有承诺,我的朋友。我只建立了几个流动站点。