1

I have three nodes:

  • Node A
  • Node B
  • Node C

In the main menu, these nodes are organized with Node B and C as children of Node A's menu item, like so:

  • Node A
    • Node B
    • Node C

When Node A is viewed, I would like to display/list Node B and C in a block under Node A's content.

I would like to do this without using the Book module. I would also like to do this without adding an extra step to the user (i.e. using entity reference on Node A).

Is there a way to do this views? i.e. to create a relationship to the menu structure?

Here's a drawing of what I'm trying to achieve:

enter image description here

Any insight is greatly appreciated.

3

I hate answering my own question here, but just to save the effort anyone might be going through, here is a module that worked for me:

Views Menu Node Children Filter

Using this module I was able to pass the node ID of the current node and filter the node's children in reference to the menu structure. Works perfectly on 8.4.

  • Couldn’t Menu Block solve this? – Kevin Oct 25 '17 at 21:21
  • @Kevin not that I'm aware of - I am trying to pass the menu children of the current node in a view. – ymdahi Oct 26 '17 at 14:31
  • Menu Block can read and folllow the active trail of the current uri and make that the starting point for output. drupal.org/project/menu_block - therefore, no Views needed. – Kevin Oct 26 '17 at 14:42
  • 1
    @felipep I wish I new which site this module was used on. I'll try and dig that up so I can share that with you. I vaguely recall using contextual filters to pass nid of the parent or something to that affect. – ymdahi Jun 11 at 20:39
  • 1
    @ymdahi thanks, I already find it out how it works, the parent id is necessary as context filter – felipep Jun 12 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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