Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to remove the trimmed version from node preview. From the link below it seems this code is working for everyone except me.
As I had some issues with zenophile I was originally working on the zen theme without any sub themes. Creating a sub theme make it work temporarily but not anymore. Thanks
http://drupal.org/node/1355962
/**
* Override node preview to remove trimmed teaser version.
*/
function theme_node_preview($variables) {
$node = $variables['node'];
$output = '<div class="preview">';
$preview_trimmed_version = FALSE;
$elements = node_view(clone $node, 'teaser');
$trimmed = drupal_render($elements);
$elements = node_view($node, 'full');
$full = drupal_render($elements);
// Do we need to preview trimmed version of post as well as full version?
if ($trimmed != $full) {
// drupal_set_message(t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication.<span class="no-js"> You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.</span>'));
//$output .= '<h3>' . t('Preview trimmed version') . '</h3>';
//$output .= $trimmed;
//$output .= '<h3>' . t('Preview full version') . '</h3>';
$output .= $full;
}
else {
$output .= $full;
}
$output .= "</div>\n";
return $output;
}
Comments
Comment #1
jdln CreditAttribution: jdln commentedI searched my instalation for the text 'The trimmed version of y' and found the theme overide I used below. All working fine, maybe the old code was out of date.
Comment #3
M Sungamnor CreditAttribution: M Sungamnor commentedDear All ,
I have installed drupal 7 .
Please solve this issues.
The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "
" (without the quotes) to fine-tune where your post gets split.
Comment #4
JamesOakleyAre you sure this is a Zen Theme issue? (If you've just installed Drupal 7, it's possible but not likely that you've installed Zen, which is a base theme). Even if it is, I doubt it's this issue (which was from 3 years ago).
I'd suggest you revisit the forum post you started with the same question. Someone's responded there, but you need to give more details about the issue before you'll get the help you're looking for.
Comment #5
M Sungamnor CreditAttribution: M Sungamnor commentedDear All ,
I have just installed drupal 7 . Template Bartik. I select add content and I edit 100 lines and click on Preview I found following message. 1)How I remove it . 2) I save this page but view is empty. Please help me for solve this issues
"The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "
" (without the quotes) to fine-tune where your post gets split ".
Comment #6
JamesOakleyAs I say - you're in the issue queue for the Zen theme, where a specific bug report from 3 years ago is being discussed. That bug was fixed long ago, so your issue is nothing to do with that, or even with the Zen theme at all (since you're not using it).
As I said earlier, you should return to your forum post, where there are now two users willing to help you but needing more information from you. You'll get no help in this issue though.
Comment #7
M Sungamnor CreditAttribution: M Sungamnor commentedHi james
Thanks for your suggestion.
Comment #8
V. Noel CreditAttribution: V. Noel commentedHello,
I tried the solutions and it did not work for my theme. I do not have a sub-theme.
First, foremost, create a backup of node.pages.inc. (modules/node/node.pages.inc)
then remove code from node.pages.inc:
also, change the message:
The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter <--break--> (without the quotes) to fine-tune where your post gets split
since you will no longer see the trimmed preview.
It cleared it right up.
If it doesn't work, try flushing the cache. (Configuration > Performance > Clear all caches > Save configuration)
Comment #9
JamesOakley>> I do not have a sub-theme.
Zen is not meant to be run without a sub-theme. It's only a base theme