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:
<a href="<?php print $row->field_facebook_page; ?>"Like</a>
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?