Drupal 7 views Contextual filters with Page & Blocks I have an issue and i'm hoping to get some advise.

I have a view created that show content based on the url:

eg:

domain.com/item/one

Shows fields for my node with the title one

domain.com/item/two

Shows fields for my node with the title two

etc etc.

The path for the PAGE in views is set to /item

What I'm having trouble with is I need to have a BLOCK (becuase I'm making it collapsable) show under that page with the specific URL show the body field for that node.

eg:

domain.com/item/three

Shows fields for my node with the title three as well as a block that show the body field for node three

I have set the Contextual filter for the PAGE to:

Content: Title

When the filter value is NOT in the URL
Show "Page not found" 

Exception value : Empty (All removed)

Under More:
Case : Lowercase
Case in path : Lowercase

Transform spaces to dashes in URL : Checked


This works for the page but please let me know if I have set this up incorrectly.

I have set the same Contextual filter for BLOCK and it works in views preview but not on the page with the URL:

domain.com/item/three

I also tried adding Global: Null Contextual filter before the Content: Title filter which allowed me to put item/three in the preview and it works (before worked with just three). This also didn't work on the actual page.

Any advise on this would be greatly appreciated.
Contextual filters works well for any display type that has a path. A path makes it easy for views to determine what information should be passed into the contextual filters.

The problem with blocks is that they don't have a path. Views does not look at the current url and automatically pass values to the filters because it has no idea which parts of the url to use.

You can get around this by using Default Values (or page manager/panels, but that's a whole other topic).

In the settings for your block contextual filter, you will want to override the configuration and select Provide a default value. Under type choose Raw value from URL and set the Path component to 2 (the path component will be different depending on your URL, but for domain.com/items/node-title the component is 2)



When you assign your block to a region, you probably want to set the allowed paths so this block won't show up anywhere else. The path component is "hard coded" so if your path ever changes you will need to adjust it.