While you include the template preprocess functions for nodes programmatically in your own preprocess override you fail to include the other ones that the node.tpl.php would expect to be in place.

Specific example: themename_preprocess_node();

If any variables are defined in there they are missing from the included template.
This patch steal a couple lines of code from theme() to load and execute the appropriate functions.

YMMV WFM

CommentFileSizeAuthor
print_preprocess.patch1.43 KBmichaelfavia

Comments

michaelfavia’s picture

Above patch graciously funded by DailyRX.com. Sorry for the bugspam.

jcnventura’s picture

Status: Active » Needs review
chipway’s picture

Great job João,

I added some variables thru a preprocess function hook_preprocess_node(&$vars), and was able to print these variables with the tpl.php template for screen media.

But i didn't get these varaiables available on the wkhtmltopdf PDF version of the node page.

After applying Michael's patch, i get these variables and do not need a specific print.xxx.tpl.php. I have them as well on the PDF version of the node page.

Thank you Michael for your patch.

João, hope you get more reviews and commit the patch. Thank you.

Léon

jcnventura’s picture

Status: Needs review » Fixed

@michaelfavia: committed it to dev.. Now to test if it works :)

Thanks for the patch!

jcnventura’s picture

Seems to be working fine.. Thanks again.

Status: Fixed » Closed (fixed)
Issue tags: -preprocess functions

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