How to have virtual navigation with more than two levels? How can I implement virtual navigation with more than two levels?

Today we have a question from Laurent Cathala, who asks how to have virtual navigation with more than two levels.

I actually thought it was quite complicated, that you had to create a custom Seam component to handle a custom XHTML widget. But in fact, you can do it all within Nuxeo Studio.

Three Level Hierarchical vocabulary Three Level Hierarchical vocabulary

First step: Create a 3-level hierarchical vocabulary

This is the part I thought was not do-able in Studio - creating a vocabulary with more than 2 levels. It’s actually quite easy, thanks to the ‘Set tree depth’ button - as you can see on this screenshot. I’ve chosen 3 and added a simple 3-level entry.

Second Step: Update the custom widget

You need a custom widget to be able to choose/view an entry in our 3-level vocabulary. You can find the code in our documentation, or right here for a three-level mono selection:



Configure a Template Widget Configure a Template Widget

Third Step: Update the layout

We must use our new template widget. You can do so when choosing Template in the Advanced Widgets. You have at least three things to configure in the widget. Select the right widget_template, enter the document field to map to this widget (for instance dublincore:nature) and do not forget to add the widget property ‘directoryName’. Its value should be the ID of your previously defined 3-level hierarchical vocabulary.

Three level Virtual Navigation 3-level Virtual Navigation

Fourth Step: Set up the virtual navigation

Now that we have our vocabulary and we can use it in our document layout, let’s set up the virtual navigation. You need to select the same document field that you used in your widget, choose the right vocabulary and add two others with the same vocabulary. Take a look at the screenshot.

And you’re all set. You just configured a 3-level virtual navigation using only Nuxeo Studio. And if you still find this cumbersome, know that this will probably be made fully automatic in one of the next versions of Studio.