How could the contextual filter "Content: Nid" return the TNID instead of NID? I am using the contextual filter "Content: Nid" in Views3, and I want it returns the TNID instead of the NID When the filter value is NOT available.

I tried the following code.

$node = node_load($argument);
$argument = $node-&gt;tnid;
return $argument; 


I also tried the following code.

$node = node_load(arg(1));
$argument = $node-&gt;tnid; // bzw. $argument(1) = $node-&gt;tnid;
return $argument; 


I used that code in Provide default value:PHP Code Field, but nothing worked.



I solved the problem by adding this code to the page.tpl.php.

$imagemenuview = views_get_view('projectimagemenu');
echo $imagemenuview-&gt;preview('block', array($node-&gt;tnid));


I am still interested in the solution using the contextual filter "Content: Nid" returning the TNID instead of the NID When the filter value is NOT available.
This PHP code should work:  

$node = node_load(arg(1));
return (isset($node-&gt;tnid) ? $node-&gt;tnid : $node-&gt;nid); 


The better way (without evil eval()) is to provide own plugun of type 'argument default' which will do work. Look at Content ID from URL argument default plugin as an example.