Can add the new variable in the existing node--contenttype.tpl.tpl?

by User7812   Last Updated January 12, 2018 12:07 PM

I have written the query in .Module file and stored the output in a variable.

Now, I want to pass this new variable in existing node--contenttype.tpl.php

My idea is to pass the variable for the existing node.tpl.php using hook_theme function

Is that a good way to achieve it or anyone has a better way for it ?

Tags : 7 theming


Answers 1


You'd be better off doing in here: https://api.drupal.org/api/drupal/modules%21node%21node.module/function/template_preprocess_node/7.x

"Processes variables for node.tpl.php" so should be ideal for what you need

Leigh Mason
Leigh Mason
January 12, 2018 11:56 AM

Related Questions


Features can export everything?

Updated March 26, 2015 10:02 AM


No image style found

Updated March 29, 2015 15:02 PM


Best way to have 5 or 6 themes in one site drupal 7

Updated April 09, 2015 22:03 PM