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 "&lt;!--break--&gt;" (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

jdln’s picture

Status: Active » Fixed

I 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.

/**
 * Returns HTML for a node preview for display during node creation and editing.
 *
 * @param $variables
 *   An associative array containing:
 *   - node: The node object which is being previewed.
 *
 * @ingroup themeable
 */
function THEMENAME_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 "&lt;!--break--&gt;" (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;
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

M Sungamnor’s picture

Dear 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.

JamesOakley’s picture

Are 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.

M Sungamnor’s picture

Dear 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 ".

JamesOakley’s picture

As 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.

M Sungamnor’s picture

Hi james

Thanks for your suggestion.

V. Noel’s picture

Hello,

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:

    $output .= '<h3>' . t('Preview trimmed version') . '</h3>';
    $output .= $trimmed;

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)

JamesOakley’s picture

>> I do not have a sub-theme.

Zen is not meant to be run without a sub-theme. It's only a base theme