XSLT for a product grid
This is an open discussion with 5 replies, filed under XSLT.
Search
Yes, there is a way.
Something like this?
Shit. I'm too late (as always). Funny to see we both got the exact same solution, though:)
Edit: there is one thing to keep in mind: the xslt will keep adding row
s when there are entries for it (say you aren't limiting to 12), nor will it create the rows, when there are no products to fill them.
Perfect! Thanks guys, it seems that approach gets the double thumbs-up. :) Plenty to learn from that snippet. I haven't used axes before and by the looks of things really need to take more advantage of XSLT modes. All very good to learn from.
Thanks.
Yeah, the "group n entries" usecase is a very good example for the use of apply-templates, modes and a few axis. Glad we could help!
Create an account or sign in to comment.
I've got a simple grid layout displaying products, 3 to a row and 4 rows. Each row is actually wrapped in a div with an id of 'row' in the grid:
I wasn't sure how to apply this in XSLT and currently I have:
Can anyone recommend a cleverer way of doing this in XSLT? I'm sure there is a better way or doing it.