How do I show first level categories of a hierarchicalMenu?

I am stumped by this. How do I make sure that the first level children of all top-level categories are displayed? I am using the hierarchicalMenu widget.
I do not see any option for displaying the children when defining the hierarchicalMenu() widget.

Any ideas?

Hi @amitramani,

Is you data structured as required in the documentation?

If so could you provide a code snippet of how you are using the hierarchical menu widget?

Hi @cindy.cullen
Yes, my data is structured to allow for multi-level hierarchical categories. When I click on a top level category, the children of that category are displayed as a sub-tree.

Here is the code for my hierarchicalMenu widget:
search.addWidget(
instantsearch.widgets.hierarchicalMenu({
container: ‘#facet-product-categories’,
separator: ’ > ',
sortBy: [‘count:desc’],
showParentLevel: true,
attributes: [
‘taxonomies_hierarchical.product_cat.lvl0’,
‘taxonomies_hierarchical.product_cat.lvl1’,
‘taxonomies_hierarchical.product_cat.lvl2’
],
templates: {
header: ‘

Categories


}
})
);

Hope you can help!

Hi @amitramani,

I’m not sure I understand your question. Could you show an example of what you see and another example of what you would like to see?