Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I found out that it is possible to create a print--pdf.tpl.php
file which will be used whenever content is printed out as PDF. My problem is that I need to print out various pages which are no nodes but custom module paths. As it is possible to create page.tpl.php files for each content types and even for specific nodes I wonder how I could implement addtional theme suggestions. Can I use hook_preprocess_print(&$variables)
in my module or template.php file? I tried to but did not success - I am not sure if I made a mistake or if it is not possible in general?!
Best,
Tobias
Comment | File | Size | Author |
---|---|---|---|
#1 | theme_hook_suggestions_overwritten-2276407-1.patch | 1.12 KB | freality |
Comments
Comment #1
freality CreditAttribution: freality commentedLooks like
print_preprocess_print
is overwriting any changes to $variables['theme_hook_suggestions'].Here's a patch to fix that.
Comment #2
tobiberlinworks... thank you!
Comment #3
AnybodyHey, I need the same thing and think it would make a lot of sense to put this into the stable release for more flexibility?
What do you think about it? It seems to work really fine! I'll set this "Needs review".
Comment #4
ckngPatch #1 solves hook_preprocess_print() not called as well.
Comment #5
asherry CreditAttribution: asherry commentedThis ticket is old but the patch still applies cleanly, and is needed by a project we have running. Committing this would be greatly appreciated.
Comment #7
jcnventura CreditAttribution: jcnventura commentedThanks!