-
Book Overview & Buying
-
Table Of Contents
Drupal 6 Theming Cookbook
This recipe will list the steps required to include a JavaScript file from the .info file of the theme. We will be using the file to ensure that it is being included by outputting the standard Hello World! string upon page load.
While the procedure is the same for all the themes, we will be using the Zen-based myzen theme in this recipe.
The following steps are to be performed inside the myzen theme folder at sites/all/themes/myzen.
Browse into the js subfolder where JavaScript files are conventionally stored.
Create a file named hello.js and open it in an editor.
Add the following code:
alert("Hello World!!");
Save the file and exit the editor.
Browse back up to the myzen folder and open myzen.info in an editor.
Include our new script using the following syntax:
scripts[] = js/hello.js
Save the file and exit the editor.
Rebuild the theme registry and if JavaScript optimization is enabled for the site, the cache will also need to...
Change the font size
Change margin width
Change background colour