drupaldrupal-viewsdrupal-contextual-filters

Filter by third argument in Drupal Views


I am trying to create a Block View filtering by the path's (actually an alias) third argument, but can't succeed.

The path where the block is displayed is sitename.com/first/second/third.

Actually the third argument is the node's author, in the end, I am trying to display a block where only the content created be the author of the node the block is in... I.e: in the content type Garage node created by user Joe, there should be a block of content type Cars created by Joe. The node's path would then be garagecars.com/garages/spain/joe.

I have tried setting 3 Global:Null arguments and then User:Uid but it doesn't work.

Caption of the Arguments in the View

Help? Any other way to filter by node author? (have been a long while searching and the "filter by path arguments" approach seemed the good one, but I must be missing something then).

UPDATE: in the Views preview the path garages/spain/joe works but it doesn't in the page itself http://garagecars.com/garages/spain/joe... which has me ever more puzzled.

SOLVED: I was inserting the blog programatically throught the views_embed_view($viewName, $display_id, $args)... that's why it DID work on preview but when the page was rendered, the arguments set programmatically overrode the one's in the path, thus not working.


Solution

  • Solved in the same question. Information provided on making this work.