clizlee Posted February 14, 2020 Share Posted February 14, 2020 Right now for all of our category pages I'm using 2 column layout, small left column and larger right column. The left column shows the Filters (faceted search). The only problem is, some categories just have no filters because those filters just don't apply to that category. So I'm wondering, is there a way to make a conditional if/then statement somewhere to say basically, if faceted search, show 2 column layout, else show full width. Does anyone know if that's possible and if so which .tpl page would I add the code into? Link to comment Share on other sites More sharing options...
NemoPS Posted February 16, 2020 Share Posted February 16, 2020 Are you using a custom template? As far as I know the left column should be hidden when no module hooks to it, in the default template Link to comment Share on other sites More sharing options...
clizlee Posted February 17, 2020 Author Share Posted February 17, 2020 I'm using child theme of the classic theme, but I do have the faceted search module hooked, but I need it hooked so that when there are available filters it shows up. But the problem is, if there are no filters, then the filters don't appear, leaving the left column empty so it looks funny in some categories. Link to comment Share on other sites More sharing options...
misterdigital Posted March 7, 2020 Share Posted March 7, 2020 It's the same for me. Has anyone found a solution to this? Link to comment Share on other sites More sharing options...
fbenoist.com Posted March 7, 2020 Share Posted March 7, 2020 Hi, You can use a different template for each category. In your theme : 1. Create a template that displays the list of products without the left column : Copy the file ../catalog/listing/product-list.tpl to ../catalog/listing/product-list-full-width.tpl and change {extends file=$layout} to {extends file='layouts/layout-full-width.tpl'} 2. Create a template for each category : Copy the file ../catalog/listing/category.tpl to ../catalog/listing/category-{id_category}.tpl (replace id_category with the category id) and change {extends file='catalog/listing/product-list.tpl'} to {extends file='catalog/listing/product-list-full-width.tpl'} 2 Link to comment Share on other sites More sharing options...
clizlee Posted March 31, 2020 Author Share Posted March 31, 2020 On 3/7/2020 at 3:15 AM, fbenoist.com said: Hi, You can use a different template for each category. In your theme : 1. Create a template that displays the list of products without the left column : Copy the file ../catalog/listing/product-list.tpl to ../catalog/listing/product-list-full-width.tpl and change {extends file=$layout} to {extends file='layouts/layout-full-width.tpl'} 2. Create a template for each category : Copy the file ../catalog/listing/category.tpl to ../catalog/listing/category-{id_category}.tpl (replace id_category with the category id) and change {extends file='catalog/listing/product-list.tpl'} to {extends file='catalog/listing/product-list-full-width.tpl'} So in step 2, would the file name be category-{55}.tpl ? or whatever the category id is? Link to comment Share on other sites More sharing options...
fbenoist.com Posted April 1, 2020 Share Posted April 1, 2020 For category 55 the file name is category-55.tpl. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now