Include js in a smarty template?

Hello - I have a smarty template header which has to bring in some .js filed for the dropdown menu. I thought it might be file path confusion, but I’ve tried the absolute path and it still does not load. What’s the deal with smarty templates and loading .js files?

thanks

There is none, but it would be helpful to see some code!

thanks -

pretty much what’s going on is in two template files - a header template ‘head.tpl’ and ‘program.tpl’ - head.tpl is a header for program.tpl.

head tpl is supposed to look as follows - http://www.itsyourworld.org/templates/head.tpl

the first lines of head.tpl are:

<html>
<head>
<title>World Affairs Council of Northern California</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript1.2" src="sample_data.js"></script>
<script language="JavaScript1.2" src="dqm_script.js"></script>

</head>

those two scripts are the problem. they are in the same dir as head.tpl. I’ve moved em around to different directories, given absolute file pathes, etc… they just don’t seem to load.

they’re being loaded from program.tpl, also in the same direcory, with the following code.

{include file="head.tpl"}

ends up giving me ‘object expected’ errors, as here:

http://www.itsyourworld.org/program2.php?page=404

if you mouse over the menu items.

weird - seems like the template system won’t let it load or something. any ideas?

The paths are relative to the PHP script that loads the templates not to the template-directory.

Try putting them in the same dir as the PHP script that uses the templates (the template dir shouldn’t be below the web-server root anyway).