r/drupal•
derSinologe

Views PHP - either the picture is not showing or the text is not formatted. What am I doing wrong?

Hi Reddit,

I'm trying to display the body of my article using views and panels but I can't seem to output the picture and the formatted text at the same time. Here's the code I'm using:

<p><strong>Here is the first try - this time without picture but formatted</strong></p>
<div class="blog-view-text"><?php echo $data->_field_data['nid']['entity']->body['und']['0']['value']; ?></div> <p><strong>Here is the second try - this time with picture but not formatted</strong></p> <div class="blog-view-text"><?php echo $data->field_body['0']['rendered']['#markup']; ?></div>

And here you can see the results: http://drupal.p131548.webspaceconfig.de/node/24

Anything that I keep forgetting?

Posted Jun 24, 2012, 1:31 AM UTC

17
Loading comments…