Hello everyone,
Setting:
I have a metaobject definition populated with many entries (115). I have this following snippet that essentially produces a <style> by looping over the metaobject and for every value, it makes a CSS rule along the lines of
[data-color="{{ xxxx }}"] { background-color: {{ yyyy }} }
Here is the exact snippet:
Expected result:
The snippet above works and outputs the expected results, example:
Problem:
The snippet DOES NOT work when in a collection page and when *?page=2* (generally when > 1). It does not produce anything. It works when *?page=1*. So my first guess is that this is a problem related with pagination.
Then I made another test where instead of paginating by 500, i paginate by 50 and sure enough when the snippet runs at any collection that has *?page=larger than 1*, it brings the metaobject entries from the 2nd page of the metaobject (so results: 51 - 100), so the page parameter interferes with the pagination of the metaobject.
That explains why the snippet does not product anything when i paginate by 500.
It simply does not have anything to show in the second page of the metaobject entries. The entries themselves are 115 (and thus have only 3 pages since 50 is the limit of Shopify loops)
Has anyone dealt with this before?