0

Is there a way to get a field's teaser value with php? I can get the fields value with some php like this..

<?php print $node->field_country[0]['value'] ?>

I tried this..

<?php print $node->field_country[0]['teaser'] ?>

But that does not work. :(

Dustin
  • 4,314
  • 12
  • 53
  • 91

2 Answers2

1

Have you tried

<?php print $node->field_country['und'][0]['value'] ?>

This could work.

If it didn't, use

<?php print_r($node->field_country); ?>

to go through the properties of the field.

Muhammad Reda
  • 26,379
  • 14
  • 93
  • 105
1

Fields don't have "teaser" and "full" values. Only nodes have teser and full views.

To see the full contents of a field array in Drupal 6, install the Devel module and use:

<?php dpm($node->field_country); ?>

Note that the previous suggestions:

<?php print $node->field_country['und'][0]['value'] ?>

relates to the structure of fields in Drupal 7.

Adam Balsam
  • 785
  • 9
  • 15