I have 3 node types:

  • category
  • subcategory
  • product

These are all linked using Entity Reference module. All pages have a path (using autopath). What I want to do is show a view depending on the path.

So if I go to categories/category-a/ I want to show all subcategories of that category Same for the products. I want to show all products referenced based on the path.

I'm trying to make a view with path = categories/%

I set a "contextual-filter: content: nid" - "provide default value" - "raw value from url". But when I visit "categories/category-a/" I see the node with this path. The view isn't shown.

Any idea what's wrong here?


You could try out this Article..

The contextual filter should be "content:nid"

The options should be set as follows...

  • The Relationship should be your "Entity Reference: Referenced Entity" relationship

  • Under "When the filter value is NOT available" check "provide default value" and select "Content ID from URL"

  • Apply changes and save view.

  • The problem is I don't see the view at all at the specified path... I'm loading all nodes with type of subcategories, maybe I should make a view starting from categories? – screaming SiLENCE Nov 28 '14 at 14:34
  • When I change the path to "node/%" it works, but that's not what I want ;) – screaming SiLENCE Nov 28 '14 at 14:37
  • Glad you found it!! – Pravin Ajaaz Nov 28 '14 at 14:45
  • It's working just fine when I show this view as a block, but what I want to do is show it as a page. – screaming SiLENCE Nov 28 '14 at 14:53
  • No, didn't find it at all ;) I want to "override" an existing path with my view, but that doesn't seem to work :( – screaming SiLENCE Nov 28 '14 at 14:54

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.