I want to generate the RSS feed of my calendar as:

PHOTO (uploaded photo)


http:://www.example.com/content/the-title (Link of feed to the content page)

For this I use a "Global: PHP" field in the calendar view I created, entering code in "Output code".

I didn't succeed in printing the node body using:

<?php echo $row->body; ?>

With this, I get the ID.

The following gives no result:

$node = node_load($row->nid);


<?php print_r($row); ?>

I got:

stdClass Object
[title] => The title
[body] => 1311
[rendered_entity] => 1311
[php] => 

How to I get the real content of the body, image link (field_photo) and the content link?



Try using these code

$body = $data->_field_data['nid']['entity']->field_image['und'][0]['body'];


$node = node_load($data->$nid);
$body = $node->body[0]['value'];

This may be because of the issue here

  • With the first, I got an empty string. The scond gives an Internal Server Error (500): Cannot access empty property. – lot108a Nov 27 '14 at 15:31
  • I did a print_r on $body. I wanted access an unexisting field, so node_load works. Thanks. – lot108a Dec 5 '14 at 7:24

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.