By Popboard on
Simple question: I have a Views field: Taxonomy: Term ID
I don't want this field to be displayed for every node that populates (so I have it hidden, but still loaded into the view). How do I go about printing out a views field manually? (example maybe something like print $views->field[2] -- which is obviously not the right syntax -- hoping one of you know what is...
Thank you!
Comments
Where are you trying to do
Where are you trying to do this? In the View or in your Theme?
If you are doing it in Views, then there is the Views Custom Field module (http://drupal.org/project/views_customfield) that lets you include PHP code in your views. If you use that, then all of your data for a record will be stored in the $data variable.
If you are doing this at the theming layer, and are using views-*.tpl.php files, then the variables you have available are $view, $fields and $row.
$fields['title']->content would be the title of the node.
$fields['tid']->content would be taxonomy ID of the node.
$fields['field_my_cck_field']->content would be the value of a CCK field that you created.
$row-> nid is the node ID of the current node.
etc.
Look at the theming information for your view.
fast women, pretty cars, sexy computers
https://coderwall.com/algorgeous/