I'm liking the ability to decide which js files and libs are loaded in layout/themes/my theme/functions.php:
Text Formatted Code
/**
* Return an array of JS libraries to be loaded
*/
function theme_js_libs_foley()
{
return array(
);
}
/**
* Return an array of JS files to be loaded
*/
function theme_js_files_foley()
{
global $_CONF;
return array(
);
}
BUT <- you knew that was coming

Maybe we could return an array of arrays for header and footer ie.
Text Formatted Code
/**
* Return an array of JS libraries to be loaded
*/
function theme_js_libs_foley()
{
return array(
'header' => array('jquery'),
'footer' => array('jquerui')
);
}
/**
* Return an array of JS files to be loaded
*/
function theme_js_files_foley()
{
global $_CONF;
return array(
'header' => array('my_theme/js/ie-fix.js', 'my_theme/js/modernizr.js'),
'footer' => array('my_theme/js/jflickrfeed.js', 'my_theme/js/prettify.js')
);
}
I know in the past I've preached all js in the footer for fast page loads, but in a dynamic content system like a blog/CMS it's almost impossible to keep out inline js. Easy to do in a static html pages, but not dynamic pages.
So now I'm always loading jquery and modernizr in the head and all others in the footer.
BUT with geeklog automatically including jquery in the footer for admin pages and the like, it overwrites the already included jquery and bombs any previously defined functionality.
Theme developers need fine control over js and css inclusion, and if geeklog needs a library like jquery for some of its functionality it needs to test for it first before overwriting a previously included version:
Text Formatted Code
<script>!window.jQuery && document.write(unescape('%3Cscript src="{site_url}/javascripts/jquery.min.js"%3E%3C/script%3E'))</script>
And theme developers need to be able to determine when and where to include their resources.
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 -
http://www.flashyourweb.com