how to move .js & .css files to before end of the <body>
Posted 10 years 1 month ago
Hello,
i want to move all .css and .js to bottom of the page but have 2 problems. "using rt-kirigami"
1. Problem when move:
<?php
$gantry->displayHead();
$gantry->addStyles(array('vmsite-ltr.css'));
$gantry->addScripts(array('rokmediaqueries.js'));
?>
the .js & .css files is OK but this method move & My meta title and page title to the bottom of the page.
I need to move to bottom only .js and .css.
2. When move again the files to the bottom and check page with the google analysis he find more on the mobile version more block render files like .css
But on the desktop view everything is fine.
Can you help me to move all .js .css files to the bottom of the page because I Want to have clear site whitout render block items.
Re: how to move .js & .css files to before end of the <body>
Posted 10 years 1 month ago
But for now this is a most important think in Page speed optimisation and after few days google will start the new update,
this update is for mobile site optimisation and when one page have Render block Scripts in head section is very bad for the
rating.
We need to edit the joomla core files and need to move scripts and style sheets from head section to the component part.
You are a designer and developer which files use Joomla to configure this head section?
Re: how to move .js & .css files to before end of the <body>
Posted 10 years 1 month ago
Well the problem is in the framework i must ask our main dev if its possible to add a function for it when you call js files to load it in the footer, but remember some js files needs to be loaded in the header (Modernizr, jQuery UI,) because they need to be loaded before the page is rendered! For css files they need to be loaded in header!
Re: how to move .js & .css files to before end of the <body>
Posted 10 years 1 month ago
Ok. Im waiting you, because this is the future of web templates, but we can execute in the end of the Component part of Joomla.
The Idea of GOogle is: head section of the site to be free & clean and then website will load quickly without render block script.
Re: how to move .js & .css files to before end of the <body>
Posted 10 years 1 month ago
Where did you read about this from Google? I talked with our main Dev and he said this isn't possible in Gantry 4 because framework is maid like that but will be in Gantry 5 only for your scripts that you can insert using atoms.