0

I have the content:path field and I want to output the containing data with a global PHP field.

it shows me this, but the output with print $row->path gives out a number only and not the content path.

Available variables

$row->path: Inhalt: Pfad

I tried print_r($data) to look for the correct output information, but I did not find anything about the field.

Is there any solution to get this field's data with PHP?

regards

1 Answer 1

2

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 and acknowledge you have read our privacy policy.

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