Liquid、JavaScriptなどに関する質問
初めまして。ご覧いただきありがとうございます。
debutを使って、theme.liquidに下記のコードでページごとに決まった文字を出したいのですが、
/policies/shipping-policy
/policies/terms-of-service.html
/policies/privacy-policy.html
/policies/legal-notice.html
のページの場合の条件はどう書いたら良いかわかりません。
無作法がありましたら申し訳ございません。
詳しい方、お知恵をお借りできると幸いです。
よろしくお願いいたします。
↓例)このような感じで記述しています。
{% if template == 'collection' %}
<h1 id="page_title">COLLECTION</h1>
{% elsif template == 'list-collections' %}
<h1 id="page_title">COLLECTIONS LIST</h1>
{% elsif template == 'product' %}
<h1 id="page_title">PRODUCT</h1>
{% elsif template == 'cart' %}
<h1 id="page_title">CART</h1>
{% endif %}
解決済! ベストソリューションを見る。
成功
初めまして、上水流と申します。
現在のtemplateでの判定に、以下のようにrequest.pathでの判定を追加することで実現可能かと思われます。
{% if template == 'collection' %}
<h1 id="page_title">COLLECTION</h1>
{% elsif template == 'list-collections' %}
<h1 id="page_title">COLLECTIONS LIST</h1>
{% elsif template == 'product' %}
<h1 id="page_title">PRODUCT</h1>
{% elsif template == 'cart' %}
<h1 id="page_title">CART</h1>
{% elsif request.path == '/policies/privacy-policy' %}
<h1 id="page_title">privacy-policy</h1>
{% elsif request.path == '/policies/refund-policy' %}
<h1 id="page_title">refund-policy</h1>
{% endif %}
ご参考になりましたら幸いです。
成功
初めまして、上水流と申します。
現在のtemplateでの判定に、以下のようにrequest.pathでの判定を追加することで実現可能かと思われます。
{% if template == 'collection' %}
<h1 id="page_title">COLLECTION</h1>
{% elsif template == 'list-collections' %}
<h1 id="page_title">COLLECTIONS LIST</h1>
{% elsif template == 'product' %}
<h1 id="page_title">PRODUCT</h1>
{% elsif template == 'cart' %}
<h1 id="page_title">CART</h1>
{% elsif request.path == '/policies/privacy-policy' %}
<h1 id="page_title">privacy-policy</h1>
{% elsif request.path == '/policies/refund-policy' %}
<h1 id="page_title">refund-policy</h1>
{% endif %}
ご参考になりましたら幸いです。
んるほどです!
機転が聞きませんでした。
ありがとうございます。
有料広告は、必ずしもリターンがあるとは限らず、コストがかかってしまいます。ネットショップを開設したばかりのころは、「予算をかけずにお客様が集まってくれる方法を実行したい」と考える方...
Byお客様との効果的なコミュニケーションを実現する[顧客管理]の新機能「お客様セグメンテーション」をご紹介!
ByShopify Marketsとは?ご利用可能な機能とご利用プランによる機能の違いShopify Marketsの管理画面 マーケットのタイプ各種設定マーケットを追加す...
By Daiki