All available variables returning node ID in views php in drupal 7 I am trying to define a custom field in D7 view, and I used views_php.
Here few variables are available as field tokens, but while using it inside the code, it doesn't return its original value, but does the node id.

Available variables:


$view: The view object.
$handler: The handler object.
$static: A variable that can be used to store reusable data per row.
$row: Contains the retrieved record from the database (e.g. $data->nid).
$row->nid: Content: Nid
$row->field_twitter_page: Content: Twitter Page
$row->field_facebook_page: Content: Facebook Page
$row->php: Global: PHP
$data: Contains the retrieved record from the database (e.g. $data->nid).
$value: Value of this field.


I need to fetch the value of "$row->field_facebook_page";
so I wrote:

&lt;a href="&lt;?php print $row-&gt;field_facebook_page; ?&gt;"Like&lt;/a&gt;


When I click on the "Like" link, the given URL is empty. When I print the variable, I get the node ID.

What am I doing wrong?
Start with print_r to see what's available:

&lt;pre&gt;
&lt;?php print_r($data); ?&gt;
&lt;/pre&gt;


You will likely end up using $data, something like:

$data-&gt;_field_data['nid']['entity']-&gt;field_facebook_page['und'][0]['value']


If that doesn't work, take a look at 
http://drupal.org/node/1140896#comment-5945164