bug?

Excursionist
699 0 7
I've been staring at my screen for the past hour trying to convince myself it isn't, but here's what happens: In order to have control over more than one data input area for each product, I've just switched to the blog instead of the product.description textarea for the text descriptions of my products. So I have a blog entitled "products", which has one entry per product. The titles of the blog entries and the corresponding product names are identical. To pull the text descriptions into the product display, I use the following identical code on the *index*, *product*, and *collection* templates:

{% for article in blogs.products.articles %}
{% if {{article.title}} == {product.title}} %}
{{article.content | strip_html | truncatewords: 16 }}
{% endif %}
{% endfor %} 
Works perfectly on the index and product pages. But weird things happen on the collection page: 5 of the texts don't show up, then 11 do, and then 3 are gone again. If I click on the links that take me to the relevant product page, the texts are there. I've been trying to debug, but I just don't get this. I have a vague suspicion that there might be some conflict here with the pagination. All of this sits within a:

{% paginate collection.products by 16 %}
(...all that stuff...)
{% endpaginate %}
here's the afflicted page: http://boutique.divalove.com/collections/tout/ I'd appreciate any help!
operation absurdist feature requests: terminated (http://en.wikipedia.org/wiki/Absurdism)
0 Likes
Shopify Staff
Shopify Staff
2002 0 41

Wow what a sophisticated hack. Cheers for that.

By default shopify cuts off after 25 items in a collection / blog. This is done because our friends over at soundfix had 1200 products in their Music collection which took about a 5 minutes to properly render which prompted me to create the paginate tag in first place.

I assume that your blog with texts contains more then 25 entries?

I recommend nesting a second paginate tag around the one you got:

{% paginate blogs.products.articles by 100 %} which tells shopify that you want a higher then default maximum.

That being said, I take no responsibility for eventual hatemail you might be getting from our database server for that =) (don’t worry about it)

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
0 Likes
Excursionist
699 0 7

thanks!

So far I have entered 40 products in the database (lots more in my garage…) but I haven’t written all the texts yet – so I have only 21 entries in my blog. Will keep your solution in mind for when I get everything done, but in the meantime – that can’t be the problem.

19 products are shown in the “all” collection, but only 11 of the 21 texts show up.

It’s not an ideal hack, since the descriptions won’t show up on the search page…but I’m still living in hopes that the search page will be liquefied one day…

(& I’ll talk real sweet to the database server…:)

oh, and p.s. on the blog page that is thus created (and which is not an officially displayed part of my site, though it might show up on google) – all the blog entries are displayed (just the texts), without any pagination.

this page: http://boutique.divalove.com/blogs/products

operation absurdist feature requests: terminated (http://en.wikipedia.org/wiki/Absurdism)
0 Likes
Excursionist
699 0 7

confirmed: it’s some sort of interference with “paginate”. When I remove the product pagination, all the texts show up.

and the

{% paginate blogs.products.articles by 100 %}
fix doesn’t work.

for the time being i’ll leave the pagination off until a fix is found.

operation absurdist feature requests: terminated (http://en.wikipedia.org/wiki/Absurdism)
0 Likes
Shopify Staff
Shopify Staff
2002 0 41

Before your paginate blog add the following code:


{% assign product_texts = blogs.products.articles %}

{% paginate ... %} 

then you can use {% for article in product_texts %} within the paginate block because the data was loaded outside of the paginate block and is therefore not affected by current page number and limits.

Tobias Lütke - Shopify CEO // http://twitter.com/tobi
0 Likes
Excursionist
699 0 7

thanks a lot, Tobi!

I’ve only managed to try it just now, and it works, though for the time being I’m using only the product pagination and not the blog pagination, since I’m still under the 25 limit. I’ll see what happens then. Looks like it should be alright.

operation absurdist feature requests: terminated (http://en.wikipedia.org/wiki/Absurdism)
0 Likes