I have created a view in a block, to display some related information to the current content type being displayed into the block. More precisely, I want to display the block only for book pages.
What I did is to add a contextual filter based on content type. For "WHEN THE FILTER VALUE IS NOT AVAILABLE", I provide a default value for "PHP contextual filter code" as follows
$node = node_load(arg(1));
return $node->type;
For "WHEN THE FILTER VALUE IS AVAILABLE", I use "Specify validation criteria" for content types with "book page".
I tried this but it didn't work. I think because I am using aliases in the url, it does not work.
What am I missing?
P.S: My final goal is actually to extract the group audience from the current book page and display the admins of that group into the block.