readme says if print.tpl.php exists in theme directory it will be detected and used before print.tpl.php in module directory. That is not happening even after flushing caches and rebuilding the theme registry.

Comments

tassos’s picture

This problem happens to me. I also tried to use print_html.node-node-type.tpl.php notation but it does not pick that up either.

Anonymous’s picture

Priority: Normal » Major
ctopher916’s picture

Same issue

danny englander’s picture

I had the same issue in: http://drupal.org/node/861916 and it had been fixed for a short time but now with 1.12, I am experiencing this issue again.

Actually, I just realized I am having another issue, taxonomy links seem to be rendered by <?php print $print['content']; ?> and not by <?php print $print['taxonomy']; ?> as I would expect for some reason, I will open a new issue. sorry.

brulain’s picture

Subscribing.

Anonymous’s picture

I have the same problem. Maybe there is a dependency on PHP version. PHP5.1.6 on Red Hat Linux has this problem but a testversion of the site on PHP5.3 / XAMPP Windows doesn't.

Drupal 6.20, Module version 6.x.1-12

gianfrasoft’s picture

Same problem. PHP Version: 5.2.5.

gianfrasoft’s picture

Priority: Major » Critical

Going back to version 6.10 solves the problem!

gianfrasoft’s picture

I think the problem is in the upgrade from vesion 6.10 to version 6.11 (even the last one doesn't go).

gianfrasoft’s picture

I solved my problem changing print.node-nodetype.tpl.php into node-nodetype.tpl.php and so changing tamplate to the node.

But it is not a solution for all.

gianfrasoft’s picture

Another workaround: put the theme file in the print module directory instead of the theme directory.

But the bug still remain.

Anonymous’s picture

I was having this problem (or a very similar one) where my custom print_[format].node-[type].tpl.php file wasn't being used, even though it was in my theme directory like the README.txt says.

I found out that my theme is actually a subtheme, and that only the base theme was listed as a theme path in the theme registry. I thought this was a bug (in Drupal) for not adding my subtheme to the theme registry, but eventually worked out that it was because my subtheme didn't specify its own page.tpl.php, it just used the base theme's one.

In short, all I had to do was copy page.tpl.php from my base theme to my subtheme and it worked!
To see if this solves the problem for you too, make sure page.tpl.php resides in the same directory as your custom print template file.

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Like BWPanda said, this is actually a comm'on annoyance with Drupal themes, as they're not considered full themes if they don't have a page.tpl.php file

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

No further info in two weeks. Closing the issue.

gianfrasoft’s picture

Status: Closed (works as designed) » Active

I don't think it works as designed!

brulain’s picture

Sure, it doesn't work as designed... with or without page.tpl.php in the same directory.

kgoel’s picture

After rebuilding theme_registry and clearing cache still the issue remains the same. Moving page.tpl.php to sub theme also didn't work.

KrisBulman’s picture

Version: 6.x-1.12 » 6.x-1.9

*edit*

This works when in the same directory as the page.tpl.php, but what is the required dependency?

This pretty much means that any subtheme that does not include a page.tpl.php cannot customize this module.

luksak’s picture

same issue here. i also tried to move my template files to the module folder. no success. the solution in #10 also didn`t work for me. any suggestions?

tim.plunkett’s picture

Version: 6.x-1.9 » 6.x-1.12

#279573: Themes can't use node-story.tpl.php without node.tpl.php is valid.
This is not.

print.tpl.php should have no dependence on page.tpl.php. Unless it is page-print.tpl.php.

Anonymous’s picture

As far as I understand, it's not that print.tpl.php depends on page.tpl.php, it's simply a bug in Drupal core in that themes without a page.tpl.php aren't recognised as a proper theme (in terms of the theme registry). Therefore, as this module rightly uses the theme registry to do it's stuff, it doesn't work when there's no page.tpl.php file.

thomsol’s picture

Version: 6.x-1.12 » 7.x-1.x-dev

OK, I'm having the same problem. My theme DOES have a page.tpl.php file

I'm trying to use a print.node-{nodetype}.tpl.php file. When I put it in the theme directory, it seems to know it's there, but won't render anything (I get a blank page). When I put it in the module directory, it doesn't recognize it, and uses the default.

I'm using a WAMP installation, with PHP 5.3.5

jcnventura’s picture

Status: Active » Closed (works as designed)

@thomsol: 7.x may actually have a problem, but that is related to the way that everything changed in D7.. There's a reason why it is still in dev only..

To everyone else, I just tried copying print.tpl.php to both a theme's folder and to a sub-theme's folder. It works.. As BWPanda explained, this is the way that the theme registry works, and I'm not about to start fixing Drupal in the module.

luksak’s picture

Version: 7.x-1.x-dev » 6.x-1.12
Status: Closed (works as designed) » Active

this issue still exists.

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

@luksak: I've tested. The issue doesn't exist.. HOWEVER, Drupal's theming suggestions are a complex beast.. I believe that this problem is caused by some particular issue in your setup.

I do enjoy being proven wrong, so if you are able to provide the steps to reproduce your problem using only your theme, Drupal core and the print module, I would be glad to try to replicate it.

kgoel’s picture

I moved print.tpl.php to theme folder so now its in both places module as well as in theme folder and is working as expected to be except for one issue that it was duplicating title, created by and time fields. I just commented out those fields in print.tpl.php in module folder and it is working for me.

jcnventura’s picture

@k g: yes, that has all been fixed in dev already, but I still need to fix some important bugs before creating a 6.x-1.13 release.

luksak’s picture

i will try it again on the next stable release. i have three templates in my print module folder:

print_mail.tpl.php
print_mail.node-event.tpl.php
print_mail.node-page_normal.tpl.php

the distinction between the node types does not work. i was kinda in a hurry so that i guess i tried moving those files everywhere possible etc. i use the print_mail module to send nodes by mail.

thank you for your time

lukas

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
leenx’s picture

Version: 6.x-1.12 » 6.x-1.14
Component: Code » Documentation

Hate to open a closed case, but I would like to get some clarification. I had the same problem as many of the above commenters.

Finding http://drupal.org/node/1281678, I noticed that the template files seems to be print_node and not print?

$variables['template_files'][] = "print_node";

I spent a whole day trying to get this to work using print.tpl.php, which did not work. When I renamed print.tpl.php to print_node.tpl.php, this seem to work.

Could this be a documentation mistake? Hope nobody else spends as much time on this as I did.

Thanks
Mailed
LeeT

jcnventura’s picture

Hello leenx,

print.tpl.php is similar to the normal page.tpl.php
print_node.tpl.php is similar to the normal node.tpl.php (that's why it has that name).

The module actually uses the node.tpl.php if print_node.tpl.php is not present. Renaming print.tpl.php to print_node.tpl.php should NOT work, unless you were actually trying to modify print_node.tpl.php in the first place.. Then of course, it works, as it always should have. The two files are fundamentally different, I don't even understand how it's possible that it works by renaming them.

The situation as you reported seems to me to be like a themer saying: I spent all day fiddling with page.tpl.php but it never worked, but then I renamed it to node.tpl.php and that worked.. I know that there's no documentation on using print_node.tpl.php, but that's because:
a) usually, it's not needed,
b) it's against the design (it means you want to show different content in your print version),
c) it's a recent addition to the code,
d) it's not working on Drupal 7 yet, and
e) anyone advanced enough to use it properly doesn't need the documentation :)

Also, you really should have opened a new issue.. The 20+ people in this thread are now reading both your post and this answer. Your case is NOT like the above cases.. The above cases are about using print.tpl.php without having page.tpl.php installed, so the theme layer can't see their print.tpl.php. That is unless some of them now have a "Eureka!" moment.

I know that I should document the module better, but between real work and maintaining the module, I barely have time for the latter. And besides, the documentation is available for everyone to edit.

leenx’s picture

Greetings jcnventura ...

Thanks for your response, because it did indeed help me understand where I think I was going wrong. Still very new to Drupal, so I find it very easy to get lost. In my project, I am trying to print a node and not page. I'm not sure I even know how to print a page yet.

As for documentation, I think the cases and comment help alot too.

Double Thanks for all the hard work!!

LeeT