0
votes

I've a problem with the content of one node.

There's a loop to display the excerpt of last news on a page. the content of the loop is :

<h2 class="title"><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php if ($node->field_news_thumb[0] && $node->field_news_thumb[0]['filepath']): ?>
    <img src="/<?php print $node->field_news_thumb[0]['filepath']; ?>" width="200" >
<?php endif; ?>
<?php print_r($node->content['body']['#value']); ?>

But there is just one news for which the title and thumb are well displayed, but the content is empty. In the backoffice I've just one paragraph in content. I found that if I add a new paragraph, the first one will be displayed on the front.

When there's just one paragraph, if I click on the title to get fullpage node. The content is well displayed with exactly the same method :

<?php print_r($node->content['body']['#value']); ?>

How can I display the full content of these nodes ?

1
Hello Maxime, what is the code of the loop? Have you correctly configured Drupal to display the content of the node in the display mode that node is currently being viewed?Matteo
Thx for your time. Well, I'm not the original developper of this website. I just have to fix this issue, so I can tell you that I just have a .tpl.php file wihich is included in the loop. The content of the .tpl.php is the code I've past in my first message. Where can I check the configuration of Drupal about the display mode ?Maxime
So you have no knowledge of Drupal at all? And you confirm this is for Drupal 7?Matteo
Effectively, I haven't yet. But I'v good experience with PHP, and somes CMS. I just check and the version of Drupal used is 6.20Maxime

1 Answers

0
votes

Ok I find the solution. I have replace

print_r($node->content['body']['#value']);

By :

$news = node_load(array('nid' => $node->nid));
print_r($news->body);

This give me the full content. I just have to shorten as I want.