Skip to main content
added 60 characters in body
Source Link
crashbus
  • 203
  • 1
  • 5

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

Edite: I'm using the current recommended version 7.x-1.0-beta4.

With the answer of Neograph734 I spot that the the dump of the field "field_image_teaser" cames not direct form "field_image_teaser". It cames from the $node Object (which is referred in every field), but I can't render that value. There is no output with: print render($node->field_image_teaser);

So is there a way to get the field collection in a renderable form to use the regular template system, or is something else wrong?

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

Edite:

With the answer of Neograph734 I spot that the the dump of the field "field_image_teaser" cames not direct form "field_image_teaser". It cames from the $node Object (which is referred in every field), but I can't render that value. There is no output with: print render($node->field_image_teaser);

So is there a way to get the field collection in a renderable form to use the regular template system, or is something else wrong?

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

Edite: I'm using the current recommended version 7.x-1.0-beta4.

With the answer of Neograph734 I spot that the the dump of the field "field_image_teaser" cames not direct form "field_image_teaser". It cames from the $node Object (which is referred in every field), but I can't render that value. There is no output with: print render($node->field_image_teaser);

So is there a way to get the field collection in a renderable form to use the regular template system, or is something else wrong?

added 349 characters in body
Source Link
crashbus
  • 203
  • 1
  • 5

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

IsEdite:

With the answer of Neograph734 I spot that the the dump of the field "field_image_teaser" cames not direct form "field_image_teaser". It cames from the $node Object (which is referred in every field), but I can't render that value. There is no output with: print render($node->field_image_teaser);

So is there anothera way to renderget the content of a field collection in a renderable form to use the regular template system, or is something else going wrong?

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

Is there another way to render the content of a field collection, or is something else going wrong?

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

Edite:

With the answer of Neograph734 I spot that the the dump of the field "field_image_teaser" cames not direct form "field_image_teaser". It cames from the $node Object (which is referred in every field), but I can't render that value. There is no output with: print render($node->field_image_teaser);

So is there a way to get the field collection in a renderable form to use the regular template system, or is something else wrong?

Tweeted twitter.com/#!/StackDrupal/status/273049040424419329
Source Link
crashbus
  • 203
  • 1
  • 5

Can't acces field collection with $content

I try to render a field collection in my node--1.tpl.php template with print render($content['field_image_teaser']) with no succes. I followed the example at http://drupal.org/node/1155752

The strange thing is, when I do a print of $content width var_dump () my field is listed:

var_dump ($content);
//...
["field_image_teaser"]=>
      array(1) {
        ["und"]=>
        array(2) {
          [0]=>
          array(1) {
            ["value"]=>
            string(1) "1"
          }
          [1]=>
          array(1) {
            ["value"]=>
            string(1) "2"
          }
        }
      }
//...  

but when I do a print of $content ['field_image_teaser'] the var_dump print out a NULL.

Is there another way to render the content of a field collection, or is something else going wrong?