Can i acess CCK node field or only standart field?
Ne_L@drupal.ru - November 12, 2008 - 22:02
| Project: | Views Custom Field |
| Version: | 5.x-1.0-beta1 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Jump to:
Description
Thanx - is good replace of Computed Field for my!
But i could not understand how to get access to CCK fields?
It possible?

#1
Currently only the fields you added to the view. To find out what data is accessible you can use:
<?phpprint var_export($data, TRUE);
?>
#2
Thanks
if it could have access to all fields of node (regardless added in view) - it would be excellent!
Good luck!
#3
In D6 you can set fields to be excluded from display. Unfortunately this isn't possible for D5. But maybe I come up with something.
#4
I won't work on the D5 version until the D6 version is stable.
patches are welcome though.
(for this problem we could introduce a cck formatter (which handles all fields) that doesn't output anything).
#5
I used node_load to access the cck fields. It probably doesn't perform too well but gets the job done. If anyone knows a more elegant solution please inform me. Sorry for the messy code, the field has a limit of 255 characters. I was using this with a table view to print media icons beside all nodes which contain videos.
<?php$nd=node_load($data->nid);
if($nd->field_video[0]['fid'] != 0){
print "<a href=\"/?q=node/$data->nid\"><img src=\"/files/images/video_icon.png\"/></a>";
}
?>