Php arguments in Views for Drupal can be the answer you need to getting your views to output correctly. Follow along as I go through a handful of very useful php arguments for Views.
I don't claim to fully understand Php and php arguments. I'm still learning, but what I do know I'm glad to share with those willing to listen.
I use php arguments mostly to get a view block to only show up on certain dynamic url pages. The first time I really used this technique was in one of my previous posts: Related Content with Views 2 in Drupal
Here are a few others with some explanations:
Similar Node Title:
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
return $node->title;
} else {
return FALSE;
}To use CCK Field Argument:
...Read more
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));









