Or better yet, can I prevent SC from wrapping ever...
# suitecommerce
k
Or better yet, can I prevent SC from wrapping every nth item with a div? Seems very old school to wrap every nth item with a row div….
d
Site configuration>Search > Result display options
Edit the columns value
No idea if you're trying to do it conditionally on a specific category
k
Yeah, trying to do this only on specific categories
Or just turn it off in general so I can control the styles with just one wrapper / row div.
I guess I could just turn it to one column for all
?
d
Setting the result display option to higher than the results per page?
k
No I mean just setting it to 1 column
d
Just set ours to 999 and you get a single column with products spanning the page width.
k
Ahh nvm, it still wraps EVERY item with a
Copy code
.row
Lol, I guess thats the only way to do it.
d
Default to grid view (3 cells). Set table view to 2 cells wide. Fire a table selector click in a ready function in the page html for the specific page?
k
Where would the best place to put this?
Copy code
if (category && category.metakeywords === "landing-lander") {
                  var body = document.body;
						      body.classList.add("special-landing-lander");
                }
Just adding a body class.. if i just add it to my extension and navigate to a page, that class remains
d
Not sure if the "Addition to <HEAD>" in the commerce category would work?
Maybe with a ready function as well as script tags?
k
Just a regular doc ready?
d
<script>console.log('this');</script> works just on that page for me, so you might not need the ready function
If it's erratic, or not working at all I'd enclose it in a jQuery ready
k
Ok, trying now. Thanks for the
999
tip!
👍 1
It works, it just doesnt remove it from other pages once you navigate away
d
Have you tried adding an else to your script to remove the class if the keyword isn't found?
You'll probably then need it in all categories, but can probably mass update if using the addition to head