Hello,

I am trying to use drupal_add_js(base_path() . path_to_theme()."/myscript.js") in the top of my node.tpl.php file for a theme I am developing for Drupal 4.7. No matter what I do I can't make it include any javascript files using this function. The documentation for this function says it will include the .js file and also include the misc/drupal.js file, which I need to make this theme work.

What am I doing wrong?

Comments

drew777’s picture

I get it now. You need to create a template.php file and put the function in there. Solved my own problem.

jivyb’s picture

Could you post exactly what code you put in the template.php file? This sounds like something I could pull off if I could learn from you what needs to go with the function. My theme already has a template.php file, so I'm wondering if you need any extra php end or close symbols or anything else?

Thanks