I have this situation where I want to include some javascript depending on whether a specific template is included. I know I can use <% require javascript(... from within my templates, but there doesn't seem to be an equivalent for inline scripts, like <% require customScript(...
I could enter the inline scripts 'manually' but I must use require for the files or Silverstripe will strip them away. Now SilverStripe seems to wait until the last <% require .. %> is found in the templates, and only then loads all files. This way an inline script added manually will sometimes precede the loading of the file it needs...
So I can either create all my little inline scripts as files or call inline scripts from code. As I don't want to create code for these templates, this is not an option. Does this make sense to anyone? Did I overlook some way to add javascript snippets to a template so that Silverstripe will move them to the correct spot?