0

I have a basic page node that contains two views in block form. The views both contain contextual filters captured from the URL. How to I publish my node to allow the user to visit /report/2002, or /report/2004, or /report/2010. The blocks are configured to display on /report/*. How do I do the same for a node?

Do I need to make my own controller with custom routing?

4
  • 1
    A view with a page display instead of the block display would generate the route automatically.
    – 4uk4
    Commented Nov 14, 2017 at 19:50
  • So the solution is to generate one of the views as a page, and add the second view as a block to that page? Commented Nov 14, 2017 at 20:01
  • Yes, this would generate the wildcard route.
    – 4uk4
    Commented Nov 14, 2017 at 20:40
  • Go ahead and put it as an answer below. Commented Nov 14, 2017 at 22:34

1 Answer 1

1

A view with a page display instead of the block display would generate the route automatically.

2
  • I had to add my second view into the footer of the first using the views configuration, in order to get both views on the one page. Commented Nov 15, 2017 at 0:45
  • In my use case, I found the view to be very slow. Changing to a controller significantly sped things up. It appears that views only queries for entity ids, then requeries for the fields of each entity of interest. My SQL statement pulls only the information I need in one query. Commented Nov 21, 2017 at 15:47

Your Answer

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

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