0

node $content variable does not contain all node elements

On my local test site the $content variable contains around 10 elements which I used to build my custom node template.

but now on the live site I only have 2 elements in the $content array.

I can't figure out why and looked everywhere but can't find where $content is set and or why the the other 'elements' of my node are not loaded in the $content variable.

using the normal 'view' all content is available. using my node--teaser.tpl.php not on the live site.

Both sites have the same modules enabled and are using similar node types.

6
  • Are they using the same theme? – gilzero Dec 27 '11 at 15:24
  • Check permissions...if they aren't set identically, users might not be able to see all the fields in your node....also there is a difference between normal and teaser views so make sure the theme isn't doing this on purpose. – Jimajamma Dec 27 '11 at 15:37
  • 1
    Did you check your display options for that content type to make sure that those fields are set to display in teaser mode? – user2014 Dec 27 '11 at 22:11
  • yes they use the same theme, versions and everything. view is set to a custom view which i copyed using the features module. checking permissions and display fields / views now. – FLY Dec 28 '11 at 8:56
  • Thnx @landing The fields where not set to 'visible' in the teaser of the node content display settings. If you post your answer below I'll accept it as answer. – FLY Dec 29 '11 at 11:03
3

Check your display options for that content type to make sure that those fields are set to display in teaser mode.

Drupal 6: admin/content/node-type/NAME-OF-CONTENT-TYPE/display

Drupal 7: admin/structure/types/manage/NAME-OF-CONTENT-TYPE/display

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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