When using contemplate to display some fields (ex CCK) it seems not to work in a proper manner.
I'm not able to display any value in the $node->content array even if I can see values in the Variables list when changing the content template.

The following code do not show anything

<?php
 
print $node->content['field_news_date'][0]['#markup'];
?>

but i can see the content in the variables list

The whole array $node->content seems empty.

<?php
 print_r $node
->content;
?>

Even using the new render() nothing id shown,

<?php
 
print render($content['field_news_date']);
?>

or

<?php
 
print render($node->content['field_news_date'][0]);
?>

Is that a bug or I'm not understanding Drupal 7?

Thanks

Comments

conspirolog’s picture

Visit admin/config/config/contemplate, checkbox named "Remove $node->content from variable list" must be unchecked. BUT remember, enabling $node->content array in drupal 7 requires a lot of memory/CPU available for PHP.

rhouse’s picture

This is NOT working correctly. I have it unchecked and there is still no content.

BTW, why is this configuration page not accessible from the standard admin menus?

conspirolog’s picture

Flush admin menu cache.
Seems that you have other content operating module enabled. Try to check this module on clean install or with other modules which possibly may cause this disabled.

dgtlmoon’s picture

Status:Active» Postponed (maintainer needs more info)

Did comment #3 resolve your issue?