Projection with Term query

Topics: Customizing Orchard, General, Nederlands (Dutch), Writing modules
May 20, 2014 at 1:10 PM
Edited May 20, 2014 at 1:12 PM
Hello all,

I just started (last week) with Orchard (1.8), but did some extensive reading and video watching. While I am able to do a lot, I run into a lot of walls like the following:

I have a taxonomy, called Categories. This taxonomy has a number of children, and they have more children. I managed to display the top level terms by creating a projection with a query that filters on the contenttype CategoriesTerm and Weight is equal to 1 (set manually for each term).

After a lot of trial and error I managed to display a good custom layout, defining the properties I wanted to show.

Now I have that in place, the categories are displayed on the homepage. When I click on one, it redirects to the Details page of the clicked CategoriesTerm. This seems trivial, so no surprise there.
Only I want to change this. How can I make it display the (direct) children of the clicked CategoriesTerm? And if no children left (leaf node/term), how to display all content items that are connected to the specific CategoriesTerm?

My guess is to use some dynamic projection, that takes tokens or querystrings? How does this work?

Thank you for your help.
May 23, 2014 at 9:45 AM
Anyone please? I am braincracking for 2 days over this.
May 23, 2014 at 7:47 PM
Could you illustrate with an example what is that you want to achieve?
May 24, 2014 at 11:57 AM
I am trying to migrate my current hand-made website to Orchard. On the website you can place your items you want to sell, something like ebay.
Your items are placed in leaf categories.

On the main page I display the top level categories (created new Taxonomy called Categories, added ImageLibrary field to the CategoriesTerm content type) with their image and name. When you click on the image I want to display all child terms of the clicked term (on a new page), but currently it just displays the details of the term that was clicked, like the title, description and the image. It doesnt seem like there is any access to the child terms on a terms detail page. How can I get that access?
May 24, 2014 at 12:21 PM
It seems that you're building a menu with Taxonomies. You can use Taxonomies Menu Items to build a second-level navigation for such menus. It automatically handles such scenarios: you can specify in the Menu widget how many levels to display and with which level to start. E.g. you can start with the level 2 and display only 1 level to get the leaves of the second level displayed.
May 25, 2014 at 9:25 AM
But can you filter on the selected term in the Taxon menu? I know that a second level menu can be displayed, but only the associated terms must be displayed, not all of the second level terms.