Active
Project:
Pdfview
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2007 at 16:55 UTC
Updated:
17 Jan 2008 at 23:31 UTC
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.
Comments
Comment #1
wsherliker commentedA 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);
Comment #2
urbanfalcon commentedThat didn't work for me, but this did: