-
Book Overview & Buying
-
Table Of Contents
Joomla! 1.5 Templates Cookbook
One of the most basic aspects of using JavaScript with your Joomla! template is including it within the page. There are two ways to do this—within the<head> element of your template, or within the<body> element of your template (best placed just above the</body> element). We'll make use of the method that uses the<head> template. (The reasons to do so are covered in another recipe of this chapter.)
Open your template's index.php template, located in your template's subdirectory within your Joomla! installation's templates directory.
1. Locate the<head> element of your Joomla! template in the index.php file and insert a<script> element that references the JavaScript file(s) that you wish to use:
<!-- some HTML omitted for brevity --> <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/js/javascript-file.js"></script...
Change the font size
Change margin width
Change background colour