ShopifyサインアップフォームをGetResponseフォームに置き換えました。フォームを送信した後、同じ場所にページを置いておきます。そのためには、現在のURLを動的に生成して、戻りURLとして渡すことができます。あなたは、私が個別にすべてのページ・タイプの世話をしているcase文に見ることができるように現在のShopifyページのURLブログページのタグ付きビュー
{% assign current_url = '' %}
{% case template %}
{% when 'page' %}
{% assign current_url = page.url %}
{% when 'blog' %}
{% assign current_url = blog.url %}
{% when 'article' %}
{% assign current_url = article.url %}
{% when 'collection' %}
{% assign current_url = collection.url %}
{% when 'product' %}
{% assign current_url = product.url %}
{% endcase %}
<form action="https://app.getresponse.com/add_subscriber.html" accept-charset="utf-8" method="post">
<!-- Show the name field (required) -->
<input type="hidden" name="name"/>
<!-- Email field (required) -->
<input type="text" name="email"/>
<!-- Campaign token -->
<!-- Get the token at: https://app.getresponse.com/campaign_list.html -->
<input type="hidden" name="campaign_token" value="xxxxx"/>
<!-- Subscriber button -->
<input type="submit" value="Sign Me Up" onclick="javascript:window.alert('Thanks for entering your email address!');"/>
<!-- Add any optional code here (explained below) -->
<input type="hidden" name="thankyou_url" value="https://example.com{{ current_url }}"/>
:ここでは私のコードスニペットは次のようになります。ユーザーがメインブログページ(https://example.com/blogs/news)にいるとき、blog.urlは/ blogs/newsを正しく返します。しかし、いずれかのタグをクリックすると、URL行https://example.com/blogs/news/tagged/diyまたはhttps://example.com/blogs/news/tagged/bizarreに行きます。だから、current_urlが値/ブログ/ニュース/タグ付き/ diyまたは/ブログ/ニュース/タグ付き/奇妙なものなどを取得するように、このケースを処理するコードを取得しようとしています。
戻り値それもOKです。タグ値を返す方法が必要です(diyやbizarreのように)。それでは、blog.url +/tagged/+
を連結できますか?
のようになります!どうもありがとうございます。 – Swagata