Liquid Access to Query Params #1872
dhruveonmars
started this conversation in
Requests for Suggestions
Replies: 1 comment
-
I agree this would be awesome, and would remove some hacks we’re doing (such as storing thing in cart attributes). The issue is that it could lead to a lot of cache miss as potentially any query param could invalidate the cache and could be a vector attack for shopify (generate millions of requests with different query parameters to bypass the cache layer). maybe we could have a new parameter in the settings that would allow a dev to whitelist a specific list of query params. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would it be possible to get access to URL params in Liquid?
Currently, a lot of themes, either need to use JS to adjust the page/DOM after it's loaded based on query params. Some others use
content_for_header
hacks, however neither are great solutions.content_for_header
can lead to bugs, can change at any point and can be unpredictable. JS means loading in all content, all the time, even if not needed or requires additional fetch requests to load appropriate items. This creates an issue with performance.Would be great if in the
request
object, we could add a property likequery_string
. This is currently available to Shopify Pixels, but not the theme.Beta Was this translation helpful? Give feedback.
All reactions