in short: Something in my zen-based custom theme is keeping a couple of cck fields from being display on my page. Basically my question is where to get access to the variables that are supposed to contain the html for the cck fields (which are missing when I was looking them in firebug).
Below I explain why I think it's looking up the variables that might bring me closer to a solution

So I made this custom node type (events) with cck fields added. Also made some content using those fields. Added some css and it all displayed fine.
Later the taxonomy terms below the title and some metadata bugged me so I followed along with a 'theming cookbook' pdf book that taught me how to make a node-events.tpl.php and simply deleted php variables like $terms. This worked great.

Obviously this also means that all this time, the view permissions of those fields have been checked and also that the display options under 'display fields' have been set to standard all the time. I also ruled out that the issue could be anything else than theme related as my cck fields do show up in a stock Drupal theme. The theme for my site is a zen-based custom theme.

So then even later, after I made a view for this node type and started adding css to that view I noticed at some point that my image field and two other fields are missing. It's hard to tell if they disappeared because of things that I did when creating the view and adding css (which would surprise me)

1 Answer 1


to test if the value of your CCK field is inside node content, I think that you can use print_r($node); in your custom node.tpl.php (in your case node-events.tpl.php) file of your theme directory, to see the list of the CCK fields (or if you use Devel module, is best use dsm($node);)

For example, I have a CCK field called field_test_text, see this screenshot using dsm($node);

enter image description here

And this is the way to test the specific value of the test field:

  <div class="content clear-block">
    <?php print $content;
    dsm($node->field_test_text['0']['value']); //dsm way
    echo $node->field_test_text['0']['value']; //echo way

I hope information be useful.

  • Yes! that helped. Didn't solve the issue, but helped. So applying this method returns the variables together with the values, so everything's there. That makes the reason why the fields disappear in this particular custom theme more mysterious though....Any ideas why these values won't turn into html on my page?
    – Immers
    Oct 17, 2011 at 8:53
  • if fields are disappearing in a particular custom theme, I think that you must paste your custom template to see if problem exist. Also you must review if you have some custom function in template.php of your theme... .Now is not clear to me your problem (Enlish is not my native language, sorry), is missing the content of fields?, or is missing the html of the content of fileds? (content appear in plain text?).
    – cigotete
    Oct 17, 2011 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.