Template files only half work in post preview

jdevries - April 21, 2008 - 17:40

Okay, I've had to put development on my website on hold for a while, but now I'm back to finish up some loose end before I can go live with it. I'll be posting a few more questions in the time to come, but let me start with this one. Please see the following images:

http://www.fslounge.com/files/teaser.png
http://www.fslounge.com/files/node.png
http://www.fslounge.com/files/preview.png

The teaser and the node image are taken from a published node. Except from some eventual minor styling issues, they are as they should be. I am however running into a problem with the teaser and node previews when creating or editing a node, as seen in the last image. In this particular case, I am using a custom node-editorial.tpl.php file to display the content of the node and teaser, and (like all my template files) it draws on CCK fields to display certain information, like the screenshots.

It seems however that while Drupal displays a correct preview of the teaser, it does not work for the full preview. I suspect because I use

<?php
print $node->content['body']['#value'];
?>
to display the node content, rather then the $content variable. Then again, I don't user the $content variable to display the teaser neither.

What would it take to display a correct post preview? Because the current state is not exactly suitable to present to users on a live site. In help would be much appreciated. :)

I could really use some

jdevries - May 4, 2008 - 09:38

I could really use some input on this one, because I'm stumped on how to fix this. Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.