Search code examples
navigationorchardcmstaxonomyprojectionorchard-modules

How to create a Menu from Taxonomy Terms in Orchard 1.7+ CMS using query / projection?


in Orchard CMS before the Taxonomy Widget was deprecated, you use to be able to create a menu of your Taxonomy terms very easily, like so:

Section

Big House (12)

  • Bathroom (1)
  • Room1 (6)
  • Room2 (2)
  • Room3 (3)

Small House (1)

Each link would display a listing of all the Content Items with the appropriate term. After the abolishment, you’re supposed to use queries > projection to handle such, though in true Orchard Style, there is zero documentation for the layman web creator [not coder/developer, which I’m fast realising Orchard is only suitable for] to be able to access and hopefully replicate. In all seriousness - I have tried everything, so can anyone tell me the steps to create this simple menu if it is indeed possible? Here is an example Taxonomy:

Section
    Big House
       Bathroom
       Room1
       Room2
       Room3
    Small House
       Room1
       Room2
       Toilet

All my attempts filtering the section term display every field of the content item, and when I use shape tracing to create an alternate to remove all the redundant data, the template is blank [obviously it’s created in code or something]. Any help will be very much appreciated, thanks.


Solution

  • ...hmm, I know exactly what you mean - Orchard's documentation is, and always has been, shameful! I needed something similar, recently, so inquired through the Forums and got no reply? So after much trial and error [code word for wasting many days on what used to be so simple] I managed to:

    *Add a query: "Section" or the likes [your questions denotes Section]
    *Add a Filter <has terms> - you should see your Taxonomy in the Terms List Box, select the parent, and "Is one of".
    *Add a Second Filter <Title Part, Title> operator -- is equal to; Value -- Section{Content.Fields.Product.Section}
    *Save and preview ;) 
    

    Then you just have to add a widget...

    Let me know how you go, but perhaps you look to another end-user friendly CMS before you get too invested - Orchard has so much potential, but is severely lacking in docs/tuts/examples etc. that you may continue to struggle. Good luck with it.