Drupal 7.22 Views: 7.x-3.7

i have the field "content:path" and i want to output the containing data with php. I use a global php field.

it shows me this:

Available variables

$row->path: Inhalt: Pfad

but the output with print $row->path gives out a number only and not the content path. Then i tried print_r($data) to look for the correct output information. but there i dont found anything about the field: content:path

any solution to get the data of this field to php?


1 Answer 1


Indeed, views PhP doesn't always get the processed field and only gives you the nid instead. You have to use $data as you tried (by the way, easier is to dpm($data) than print_r).

if it doesn't give you any info on what you're looking for, you can simply obtain your content:path by using drupal_lookup_path :

$path = drupal_lookup_path('alias', 'node/' . $data->nid);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.