jQuery include location in Concrete 5.7

Permalink 1 user found helpful
Hi, since concrete seems to include jquery.js file in the head of my pages, I want to include this one in my footer for an increase of performance. I found the include of jquery were in 'header_required.php' in last versions of concrete, but I have 5.7 and I don't find it in that file.

Does someone know where concrete's file jquery.js is included ?
Thanks a lot

View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Under application/config, go to app.php. You can enter an "assets" key here, like the example below (this is the full file):

<?php
return array(
    'assets' => array(
        'jquery' => array(
            array(
                'javascript',
                'js/jquery.js',
                array('position' => 'F', 'minify' => false, 'combine' => false)
            )
        ),
    )
);


If you refresh your page, you see ONE bit of javascript being used right above jquery.js. You will have to find a way to move this down, otherwise this won't work. Perhaps someone else can kick in and throw a solution to this problem?
exasystems replied on at Permalink Reply
Thanks for the answer,

It puts it just before the </body> and that's fine, but my other js files are in my footer and jquery.js gets loaded after them (and I use it in them).

My goal here is to combine & minify all the js files I need since my website is really slow on loading.

EDIT: Ok I've put my js includes after the jquery include but, as you said, there's some js before jquery's include and I don't know where it's been generated.

<script type="text/javascript">
$(function() {
   $('html').addClass('ccm-toolbar-visible');
   ConcretePanelManager.register({'identifier': 'dashboard', 'position': 'right', url: 'http://localhost:8080/ccm/system/panels/dashboard'});
   ConcretePanelManager.register({'identifier': 'page', url: 'http://localhost:8080/ccm/system/panels/page'});
   ConcretePanelManager.register({'identifier': 'sitemap', 'position': 'right', url: 'http://localhost:8080/ccm/system/panels/sitemap'});
   ConcretePanelManager.register({'identifier': 'multilingual', 'position': 'right', url: 'http://localhost:8080/ccm/system/panels/multilingual'});
   ConcretePanelManager.register({'identifier': 'add-block', 'translucent': false, 'position': 'left', url: 'http://localhost:8080/ccm/system/panels/add', pinable: true});
   ConcretePanelManager.register({'identifier': 'check-in', 'position': 'left', url: 'http://localhost:8080/ccm/system/panels/page/check_in'});
   ConcreteToolbar.start();
});
</script>
<script type="text/javascript">$(function() { jQuery.datepicker.setDefaults({dateFormat: 'yy-mm-dd'}); });</script>



EDIT 2 :

Apparently I found this javascript probably comes from another asset that comes before the jquery one.
I did some tests and found from 'concrete/elements/footer_required.php' that
this :
print $v->markFooterAssetPosition();

may be placed somewhere else in the page and the annoying js lines and still up the 'jquery,js'. I just don't know how I could identify which asset is this and how to put it after the jquery one.

footer_required :
$c = Page::getCurrentPage();
if (is_object($c)) {
    $cp = new Permissions($c);
    Loader::element('page_controls_footer', array('cp' => $cp, 'c' => $c));
}
$_trackingCodePosition = Config::get('concrete.seo.tracking.code_position');
if (empty($disableTrackingCode) && (empty($_trackingCodePosition) || $_trackingCodePosition === 'bottom')) {
   echo Config::get('concrete.seo.tracking.code');
}
$v = View::getInstance();
print $v->markFooterAssetPosition();
// user profile menu
Loader::element('account/menu');