I would like to use a CCK field as a class name for a td in the Calendar module:
e.g. from calendar-month.tpl.php:
<td id="
<?php print $cell['id']; ?>"
class="<?php print $cell['class']; ?>
<?php print $fields['field_eventtype_value']->content ?>
">
How do I get field_eventtype_value out of Views so I can use it? The above outputs nothing for field_eventtype_value.
Thanks 🙂
CCK fields are attached to nodes, so if you want to get the value the field, you first need to know which node you want to get the field value from.
What you do in views, is to create filters that generate the SQL needed to get the nodes you want.
Anyways, if you want to get the value for a CCK field, the easiest thing you can do, is to load the node using
node_load. Then the node object will have all the CCK fields attached.With code this will look something like this: