-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STRF-4679 - fixing product layout when sidebar off #1205
Conversation
Autotagging @bigcommerce/storefront-team @davidchin |
templates/pages/category.html
Outdated
{{> components/category/sidebar}} | ||
</aside> | ||
{{/or}} | ||
{{#if theme_settings.shop_by_price_visibility}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work. Currently it is just shop by price but if you have faceted search enabled there are other elements in the side bar https://github.com/bigcommerce/cornerstone/blob/67305e81473f01a93a351ad4b2e80b60fc9c66ba/templates/components/category/sidebar.html.
This change will hide those blocks as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
figured as such - fixed
@@ -18,3 +20,4 @@ <h5 class="sidebarBlock-heading">{{category.name}}</h5> | |||
{{> components/category/shop-by-price shop_by_price=category.shop_by_price category_url=category.url}} | |||
{{/if}} | |||
</nav> | |||
</aside> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified sidebar is only used by category.html
templates/pages/category.html
Outdated
{{#if theme_settings.shop_by_price_visibility}} | ||
{{> components/category/sidebar}} | ||
{{/if}} | ||
{{/if}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junedkazi fixed to handle the cases separately. if you have suggestions or if you can point me in the direction of whatever templating lang this is so i can read up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is https://handlebarsjs.com
{{> components/category/shop-by-price shop_by_price=category.shop_by_price category_url=category.url}} | ||
{{/if}} | ||
</nav> | ||
</aside> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified this is only used by the file im changing - also not sure why the diff is showing like this all i did was move the aside tag in here
templates/pages/category.html
Outdated
@@ -25,9 +25,15 @@ <h1 class="page-heading">{{category.name}}</h1> | |||
{{{snippet 'categories'}}} | |||
<div class="page"> | |||
{{#or category.subcategories category.faceted_search_enabled category.shop_by_price}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the if/elseif below can be moved into this #or block helper. We import most of https://github.com/helpers/handlebars-helpers#helpers so you can use #or and #and together to achieve the same thing.
Try this:
#or category.subcategories category.faceted_search_enabled (and category.shop_by_price theme_settings.shop_by_price_visibility)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try this instead:
{{#any category.subcategories category.faceted_search_enabled (all category.shop_by_price theme_settings.shop_by_price_visibility)}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both have the "TypeError: Uncaught error: opts.inverse is not a function" error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, forget that, I guess you need an else clause for that to work. I would just go back to your current solution, but can you get rid of the redundant #or
that wraps all this?
@tpietsch Looks good. Can you add an entry to the changelog? |
What?
Added the theme setting check for the shop by price sidebar
Tickets / Documentation
https://jira.bigcommerce.com/browse/STRF-4679
Screenshots (if appropriate)
@bigcommerce/platform-engineering @bigcommerce/storefront-team