Passing Replacement Patterns no PHP code
| Project: | Views Custom Field |
| Version: | 6.x-1.0 |
| Component: | Documentation |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hello!
I am trying hard at this for two days now, and I think the time has come to ask for support! I think the image is quite self explanatory, but I will explain in verbally, if not only to make it accessible to search engines.
I am having real difficulty passing the values normaly output by Replacement Patterns such as [filepath] (which work fine in normal Views2 fields) to a Custom Field using PHP. Documentantion tells me $data: contains the retrieved record from the database (e.g. $data->nid). so I assumed replacing the "nid" by whichever Replacement Pattern I had summoned in fields above. It is not working.
I am afraid that maybe this is a deeper lack of knowledge about Drupal/PHP, but I can't even tell that. I have managed to write something in PHP and Javascript. and things have been working... but this one I cannot figure out.
Thank you for any help.
| Attachment | Size |
|---|---|
| Edit view projectlistcronologia | NGM alpha.png | 111.61 KB |

#1
Try using print_r($data) first.
#2
Thank you so much!
I've been usng that tip, but for some stupid reason, i put a php command in my template, and now I understand: it printed variables that had to do with the template. Now that I wrote
echo '<span class="list-obra">' . print_r($data) . '</span>'I see all the beautiful variables I needed, with strange names I would never guess.Thank you again for your reply. :)
#3
#4
Automatically closed -- issue fixed for 2 weeks with no activity.