1
votes

I am wondering if there is a way to get the full URL using only liquid (Shopify templating language). I know there are the below provided but none of them (even combined) seem to achieve it. It can be done with javascript using window.location.href, but I am wondering if there is a liquid-only method. For my use having to combine javascript in with my liquid makes it become a lot more complicated, hence my question.

{{ page.url }}
{{ shop.url }}
{{ shop.domain }}
{{ collection.url }}
{{ product.url }}
{{ blog.url }}
{{ article.url }}
{{ article.comment_post_url }}
{{ canonical_url }}

For instance, if my URL was www.website.com/blogs/myblog/tagged/?123 and I wanted the entire URL, including the ?123. The answer may be no, but this would seem pretty daft given they have all of the below options but not simply one for the entire URL. In my case I am going directly to the URL in the form of a href, so it is not a problem that liquid is only being applied on page load.

1

1 Answers

2
votes

Here is the one of odd method to get the values from the query string of URL, but it comes with some coding working, you can it using this link