I too am wanting a slide-show on the main page (only one frame though), and have got this running OK, except I can only load the additional jscript globally but I need it to only run on the main page. I can't get my head around the template system here, so any advise would be greatly appreciated. To get the additional javascript to load I have modded a template driven file:
includes/templates/MY_TEMPLATE/common/html_header.php
and hard-coded the links to the script files that are residing in:
/includes/templates/MY_TEMPLATE/jscript/
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/file1.js"></script>'."\n";
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/file2.js"></script>'."\n";
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/file3.js"></script>'."\n";
It looks to me like they are supposed to auto-load but nothing happens unless I hard code it. Existing code snip below:
/**
- load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
}
/**
- load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
}
I have tried getting the script to load by adding the script files into:
includes/modules/pages/index/
but it doesn't work.
So does anyone know where to put the script file so that ONLY a specific page within Zen Cart will load it? I have read several articles saying it can be done, but none of the instructions are right....
Adrian