Views 3.x Node Argument
In using Views 3 recently, I found, as I’m sure most everyone else has, that it has had some significant changes in the new release. The one that got me recently was triggering the display of a Content field with the argument based on the current node ID.
Before, in Views 2, it required a Node: NID argument, with the default argument being a couple lines of PHP:
if (arg(0) == 'node' && is_numeric(arg(1))) {
$args[0] = arg(1);
}
return $args;
Now in Views 3, everything is done with “Contextual Filters”. To accomplish the same thing in Views 3 add a Contextual Filter under Advanced. “Provide Default Value” -> Content ID From URL.
Done.
