Creating a multi-level navigation menu - automatically?

Topics: Administration, Core, Customizing Orchard, General, Troubleshooting
Jan 9 at 4:15 PM
Edited Jan 9 at 4:17 PM
The thing is: I have the following content types:
  • Organisation
  • Department
  • Process
  • Sub-process
How can I make a hierarchical menu based on this? I want it to look like this:

Organisation 1

Department 1

Process 1

Sub-process 1

Sub-process 2

Process 2

Sub-process 1

Sub-process 2

Department 2

Organisation 2

....

The content-types are now linked through ContentPickerFields. So the Organisation-type has a contentpickerfield "Departments" that has contentitems of type "Department". Departments has a contentpickerfield "Processes" that has contentitems of type "Process". etc.

At first I was going to use "Containers" to do this, but I found out there can only be one container to a contentitem. We have a requirement of the contentitems being contained by more than one container. The contenttypes you see listed above are not all contenttypes that are being used in our project.

I tried creating a projection and somehow defining a join between Organisation.Departments.Ids and Department.Id but I couldn't figure out how to do it. Of course, if I were to succeed doing this, I'd still have to also create joins for Department.Processes.Ids contains Process.Id and Process.SubProcesses.Ids contains SubProcess.Id.

Note that SubProcess may sound weird (you'll probably say it's not needed, because a Process can be a SubProcess too), but we really require to have the structure to be like this.

So what I want is the menu to show multi-level nodes. Root node = Organisation, leafnode of that = Department, leafnode of that = Process, etc.
Jan 9 at 4:37 PM
Edited Jan 9 at 4:38 PM
Maybe I could make all these content-types taxonomy terms? Would that make it easier to generate such a menu?
By making them taxonomy terms, I could (I think) eliminate the contentpickers that I now require.

Though I'm still not sure on how to proceed with this.
I see Bertrand mentioning it here: https://orchard.codeplex.com/discussions/474335
Jan 10 at 12:13 AM
Hi hkui, I would agree that Taxonomies is the way to go if you want to get that type of hierarchy into a navigation automatically. Once you get your Taxonomy in place, you can start out with the Taxonomy Menu Widget to inject your new menu into your website. Let me know if you have further questions.
Jan 10 at 7:31 AM
jao28 wrote:
Hi hkui, I would agree that Taxonomies is the way to go if you want to get that type of hierarchy into a navigation automatically. Once you get your Taxonomy in place, you can start out with the Taxonomy Menu Widget to inject your new menu into your website. Let me know if you have further questions.
Well yeah, I haven't tried it yet, but does the nested taxonomies allow me to also create a nested menu?
Jan 10 at 2:21 PM
Hi hkui,

Yes, you use the new "Taxonomy Link" in your navigation to inject a taxonomy right into your existing menu structure. Here is an example of the results:

Image

As you can see, I have all of the big cities listed under the County in my taxonomy (I only have one level but works for multiple nested levels). Hope this helps.