1

I have a tree of taxonomies, these taxonomies are the menu of my site and they are working with taxonomy_menu module, I am displaying the menu through a view, but I'm only showing the children as low level, for example:

  • Parent 1
    • Child 1
    • Child 2
    • Child 3
      • Test 1
      • Test 2
      • Test 3
      • Test 4
  • Parent 2
    • Child 4
    • Child 5
    • Child 6
  • Parent 3

If access to view link parent1 show me only:

  • Child 1
  • Child 2
  • Child 3

If access to Child 3 links show me the children of child 3

  • Test 1
  • Test 2
  • Test 3
  • Test 4

But if access to test 1 show brothers need taxonomies:

  • Test 1
  • Test 2
  • Test 3
  • Test 4

If filter by parent term works for me but when the taxonomy have more children, but when you have no more children need to show the brothers.

Any idea?

1 Answer 1

1

You could create a custom module that looks for the children of that element, if returns 0, look for the parent of the element and print that parents children.

You could also try views, they have a function that helps to deal with results behavior when you don't find any elements related to you query.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.