I've been bashing my head against this one all day - I've just updgraded to 6.12 and the new theming system is causing a [what should be fairly simple] problem I can't seem to fix.
The relevant section of my current print_pdf.CCKType.tpl.php template looks like:
<h1 class="print-title"><?php print $print['title']; ?></h1>
<div class="print-content"><?php print $print['content']; ?></div>
foo
Immediately after 'foo', you can see my template diverts from the default by removing $print['taxonomy'] as well as $print['links'].
Well, I'm still getting taxonomy (in the form of Tags: x, y, z) being printed out in my PDFs. So, it's part of $print['content']. Hmm, why is this doubled up? Why have it as part of content as well as it's own array $print['taxonomy']?
If it's got to be in content, how can I modify the $print['content'] object to not include Taxonomy? I glean from the documentation that theme_print_node or theme_print_page might be the key, but I'm not sure I follow what to do in the theme override there.
Any help would be greatly appreciated - I'm really sick of this right now...
Comments
Comment #1
jcnventuraYou have to copy your node.tpl.php to a file called print_node.tpl.php and edit that one..
João
Comment #2
wrightnow commentedThats it? Well, it worked, but I'm not really sure why.
As I interpreted the template instructions, the module cascades through the following templates, and runs with one if it finds it.
Since I had created both a print.tpl.php and print.node-[mytype].tpl.php, I'm not really sure a) where print_node.tpl.php gets called or b) why my print.node-[mytype].tpl.php wasn't sufficient to alter the output. Is there some kind of cumulative cascade effect I don't understand? As a followup, why is the creation of print.node.tpl.php not mentioned in the documentation? I'd be happy to contribute the work there...
Also, thanks for the prompt response...
Comment #3
jcnventuraThe print_node.tpl.php is still undocumented, as this was a "submarine" patch that changed the way things work in the background. I'm planning to change the way the templates work in a few versions, and the documentation will be updated once I do that.
João
Comment #5
beyond67 commentedWhat i did was replaced
print $print['content'];withprint $node->body;in the print.tpl.php file.Comment #6
Tafa commented#5 didn't work for me.
Comment #7
hutch120 commentedbeyond67 you champion! Been trying to figure this out for an hour.
Just one question, how did you know that $node was available? Sometimes these simple things seems so unintuitive to me. Do you use the firebug addon? http://drupal.org/project/drupalforfirebug