In light of 5.7, has this been solved? I know you can include stuff dynamically using the new asset management system, but it still renders the blocking jquery script in head.

To that end I set about changing where the script is rendered, to the footer, by overriding the application/config/app.php but this prevented the UI from functioning correctly when logged in. What I think might work is to check when the user is registered, then conditionally set a flag to either render the script tag in the header or footer.

This is my override code:

<?php// include order of scripts - jquery in footer.returnarray('assets'=>array('jquery'=>array(array('javascript','js/jquery.js',array('position'=>'F','minify'=>false,'combine'=>false)))))

'position' => 'F' is what renders it in the footer. Setting this to 'H' renders in the header. I tried adding a conditional above the return array, but it breaks the code and yields a white screen. I suspect this is not the place to do this - where would be the best place? Is there a proper way to handle this?

I found that you can conditionally re-register the jquery asset, pushing it into the header when it may be required, and down to the footer in normal mode by adding an event listener within the /application/bootstrap/app.php file as follows:

This is really good and works very well, but one downside is that it appears to break the imageslider; images will no longer slide across, just stay frozen on the first image. I've managed to hack the imageslider a bit to get 99/100 on PageSpeed insights: