1

I am new to drupal, so this issue may be something extremely basic that I am missing.

Basically, I have 2 views. A parent and a child. There are 3 content types. Industries, Applications and Minerals.

I need the parent view to show all industries, then the child view should show the applications within each industry, which are linked using an Entity Reference field.

Can someone please point me in the right direction on how to pass a contextual filter from the parent view to the child view. Basically i need to filter the child view on the title field of the parent view.


FIXED

Used NID instead of Title!

1 Answer 1

3
  1. Create two views or one view with two displays
  2. Configure Parent view or display
  3. Configure Child view or display and add context. filter by parent node title (this can be provided by Relationships). You can test it by passing one of Parent node title to Preview textfield.
  4. Open parent view or display, add Global:View field, choose your child view and display in settings.. Important part: you need to provide parent node's title as an argument to Contextual Filters input of Global:View settings, for that expand Replacement Patterns, find Title pattern, it should be somthing like [!title], copy it and past it into Contextual Filters input of settings form.

I didn't test it but you can correct it by your needs.

2
  • Thanks for the reply, how do i set up the relationship?
    – Sean Lang
    Dec 12, 2013 at 13:52
  • I got it working, it was because I was using Title instead of Node ID! Always something simple, I won't make that mistake again!
    – Sean Lang
    Dec 12, 2013 at 16:48

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.