Developer forum

Forum » Swift » Navigation, show only one group and children

Navigation, show only one group and children

Johanne Glimsdal
Johanne Glimsdal
Reply

Hello! 

I can't find any solution to make this work: 
I would like the navigation to only show the group that shows in the url, and the children of this group. 
Now it shows every group in products. 

Is there a way to make this work?


 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Johanne

On the Navigation and Facets service page, you have these settings for Navigation:

The chosen option under "Group layout" is what you need. That will give you a context aware group navigation.

BR Nicolai

Votes for this answer: 1
 
Johanne Glimsdal
Johanne Glimsdal
Reply

Thank you!

Is there a way to use the same type of layout ?
Now it look like this.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

You want to show it like this?

  • Category
    • Sub cat 1
    • Sub cat 2
    • Sub cat 3
    • Sub cat 4

Or do you just want the "Categories" name to be the name of the parent category?

If you want to change the use of the name "Categories" to the parent name, you can change the template like this:

An alternative is to set start level to 1 instead of 2:

That will also kind of work, but looks different and might not be what you want.

Votes for this answer: 1
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

If you want to keep the tree like functionality, then you can change this bit:

Change expand mode from 'All' to 'Path'

Votes for this answer: 1
 
Johanne Glimsdal
Johanne Glimsdal
Reply

Thanks again!

Still trying to figure out how to get the plus signs (same as the first photo)
But for now, it works fine with what you showed me. 


Couldn't see any difference when changing ExpandMode from .All  to .Path

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

If you need to +'es further down, you need to use expand mode all and modify the template to not render children not under the current parent.

 

You must be logged in to post in the forum