PDFView misses off node image in its output...

wsherliker - October 17, 2007 - 16:55
Project:Pdfview
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I patched the code so that if node_images are enabled for this node then the content includes this at the top of the page when outputing to the PDF converter.

The change was a relatively minor one in the pdfview.module where lines: 190-194 became:

$content = "";
if ($node->node_images) {
$content = $node->node_images;
}
$content .= drupal_render($node->content);

instead of

$content = drupal_render($node->content);

This now supported the node images in the output.

Please can you make this amend to future releases as it seems quite useful!

Cheers

W.

#1

wsherliker - October 19, 2007 - 10:39

A further amend which now checks whether the content type has node images enabled in the body beofer adding them to the PDF.

// 19/10/2007 Warren Sherliker: Patch to show node_images (if this content type has them enabled)
$content = "";
if ($node->node_images) {
// Check whether the node body shows any node_images images or not...
$body = variable_get('node_images_body_images_' . $node->type, 100);
// A blank body entry implies show all images - to make sure this works we default it to 1.
if ($body == "") $body = 1;
// Show the images
if ($body > 0) $content .= $node->node_images;
}
$content .= drupal_render($node->content);
// 19/10/2007 Warren Sherliker: End Patch

instead of:

$content .= drupal_render($node->content);

#2

urbanfalcon - January 17, 2008 - 23:31

That didn't work for me, but this did:

  if ($node->type == "image") {
      $content .= '<img src="'.$node->images['_original'].'"/>';
    }

  $content .= drupal_render($node->content);

 
 

Drupal is a registered trademark of Dries Buytaert.