We added multiple facets just above the category tree, on the category pages. The facets are working great, but they take up too much space and push the category tree way down the page. Is there a way to collapse available facets by default, so the customer can expand them as needed? It would also be nice if only the facets used by the customer are expanded.
Announcement
Collapse
No announcement yet.
Collapse Facets by default
Collapse
X
-
Collapse Facets by default
--
Henry D. Melamed - President
Advanced Development Solutions, Inc - http://www.stlads.com
Merchant Modules, Integration and Custom Design
"Internet Solutions Provider"Tags: None
-
Hi Henry,
If you would like to have the facets collapsed initially, remove the "data-a11y-toggle-open" attribute from the facet set DIV.
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
-
Thank you Matt! That worked.
Is there an easy way to expand only the facets used by the customer?--
Henry D. Melamed - President
Advanced Development Solutions, Inc - http://www.stlads.com
Merchant Modules, Integration and Custom Design
"Internet Solutions Provider"
Comment
-
Hi Henry,
Easy, not as such. However, you could determine if a facet is active and then apply the "data-a11y-toggle-open" attribute to the facet set DIV.Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
Not sure if this is the best way to do this, but I was able to expand active facets by adding this IF statement inside the DIV tag:
<mvt:if expr="l.settings:facet:input_value_count GT 0">data-a11y-toggle-open</mvt:if>--
Henry D. Melamed - President
Advanced Development Solutions, Inc - http://www.stlads.com
Merchant Modules, Integration and Custom Design
"Internet Solutions Provider"
Comment
-
Is there a way to have the Category facet remain open and have the others closed?
This didn't quite do it:
Code:<mvt:if expr="l.settings:facet:code EQ 'catgeory'"> <div id="facet-set__&mvte:facet:code;" class="c-form-list__item x-facet-set__list x-collapsible-content__item" data-a11y-toggle-open> <mvt:else> <div id="facet-set__&mvte:facet:code;" class="c-form-list__item x-facet-set__list x-collapsible-content__item"> </mvt:if>
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Hi Leslie,
In your facets layout HTML, you should be able to remove the attribute "data-a11y-toggle-open" and have the facets be closed on load.Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
Comment