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

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

You have to copy your node.tpl.php to a file called print_node.tpl.php and edit that one..

João

wrightnow’s picture

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

1. print_[format].node-[type].tpl.php in the theme directory
2. print_[format].node-[type].tpl.php in the module directory
3. print_[format].tpl.php in the theme directory
4. print_[format].tpl.php in the module directory
5. print.node-[type].tpl.php in the theme directory
6. print.node-[type].tpl.php in the module directory
7. print.tpl.php in the theme directory
8. print.tpl.php in the module directory (supplied by the module)

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

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Fixed

The 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

Status: Fixed » Closed (fixed)

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

beyond67’s picture

What i did was replaced print $print['content']; with print $node->body; in the print.tpl.php file.

Tafa’s picture

#5 didn't work for me.

hutch120’s picture

beyond67 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