2
votes

I have a taxonomy named My Taxonomy with four terms: TermA, TermB, TermC, TermD. I also have a navigation menu into which I added this taxonomy as a link.

Here are the relevant Edit Taxonomy Link values:

  • Taxonomy My Taxonomy
  • Root Term Parent Taxonomy
  • Display top level menu item false (or true - neither works)
  • Levels to display 0
  • Menu text My Taxonomy <----- (this is what Orchard isn't rendering)

What I want on the front end:

  • My Taxonomy
    • TermA
    • TermB
    • TermC
    • TermD

What I get on the front end:

  • TermA
  • TermB
  • TermC
  • TermD

How do we cause Orchard to render a Taxonomy Links Menu text?

Edit:

This is my current kludge in pseudo code:

for (var i = 0; i < childMenuItems.Count; ++i)
{
    var childMenuItem = childMenuItems[i];
    if (childMenuItem.Content is TermPart)
    {
        // render the taxonomy terms
        var taxonomyName = childMenuItem.Content.Container.TaxonomyPart.Name;
        var termMenuItems = (childMenuItems as ICollection<dynamic>).Where(c =>
            c.Content is TermPart &&
            c.Content.Container.TaxonomyPart.Name.Equals(taxonomyName));
        i += termMenuItems.Count();

        // rest omitted
    }
}
1

1 Answers

1
votes

Seems like you missed this checkbox: [] Display top level menu item. You'll need a root term to contain the others. If you don't like that solution, just add a static menuitem with the name of your taxonomy and put your taxonomy menu items under it.