Drupal7: How could Contextual filter: Content: Nid return the TNID instead of NID in Views3

535 Views Asked by At

I have a Contextual filter: Content: Nid in Views3 that I want to return the TNID instead of the NID When the filter value is NOT available.

I tried

$node=node_load($argument);
$argument = $node->tnid;
return $argument; 

or

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

and others from inside the Provide default value:PHP Code Field. Nothing worked.

1

There are 1 best solutions below

0
On BEST ANSWER

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

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

but still interested in the solution using Contextual filter: Content: Nid returning the TNID instead of the NID When the filter value is NOT available