-
Intercepting and overriding variables and Making new variables available in Drupal theme
over 9 years ago
over 9 years ago
grasp and override the existing variables, to do it we use a function in the template.php file
For example
Please note variables have to be passed by reference (&$vars). Please Clear the theme registery after saving the changes. Otherwise they wont pickup the changes you have made. If not clear how to clear the theme registery please visit Clean Theme Registery
As we have override the existing variable is assigned in same manner. you need to write the preproccess function in template.php file under the activated theme folder. Do not forget to clear the cache
For example :
now newvariable_name will available in variable array of theme. Note I have included the t function to provide for translation of the new string.
Printing variable
Thanks
Can you help out the community by solving one of the following Automation problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)