I've looked up a couple ways to do this, but none work quite how I would like them to. I want to require JavaScript using the template, rather than the controller, so that I can put it in specific places. I'll have modernizr at the top and jquery + custom scripts at the bottom of the page. According to the documentation at http://doc.silverstripe.org/framework/en/reference/requirements, I should be able to do that with:
<% require javascript(cms/javascript/LeftAndMain.js) %>
It can't seem to find it, I've tried several variations on that with different paths. The page loads, but where the script tag should be is just blank. I was able to get the scripts to load with:
Requirements::javascript("themes/tcc/js/modernizr-2.6.2.min.js");
But that doesn't allow me to set the position. It also doesn't lend itself well to theme development, since it's outside of the template directory. I can also get it to work with a standard script tag:
<script src="/themes/tcc/js/jquery-1.9.1.min.js"></script>
But that doesn't really take advantage of the SilverStripe templating engine. Any suggestions?