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
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

casey - November 13, 2008 - 11:44

Currently only the fields you added to the view. To find out what data is accessible you can use:

<?php
print var_export($data, TRUE);
?>

#2

Ne_L@drupal.ru - November 27, 2008 - 11:34

Thanks
if it could have access to all fields of node (regardless added in view) - it would be excellent!
Good luck!

#3

casey - December 7, 2008 - 20:22

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

casey - January 9, 2009 - 18:49
Status:active» postponed

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

keyo - January 12, 2009 - 01:50

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>";
  }
?>

 
 

Drupal is a registered trademark of Dries Buytaert.