Delay Loading a Block Automatically after Page Loads
Permalink
Just a thought. Is there a way to delay loading of a block, such as a slider, after the page loads? Have product slide blocks at the bottom of pages and it would not make a difference to the user experience if they were loading once the page loaded. Looking to speed up initial page loads.
Mainio, Thanks for your support! Thought this may be the case as I have used Miser to have Jscript moved to loading last. Was hopeful there may be another way to have the block automatically activate after a full load of the page. Thanks for giving a little detail on 5.5 as I am patiently waiting for its release. Tim
There is a new ajax paging block that can be used to achieve this sort of thing.http://www.concrete5.org/marketplace/addons/rapid-ajax-paging/...
John, Thanks for the heads up! Nice add-on, will look further into, if not for the current project, for another. Thumbs up for Tony, great looking example site as well. Tim
Usually you add page header items in the block's controller like this:
In 5.5 you can also add footer items exactly the same way:
However, there's no "single button" from which you could enable this for all JS in all blocks. So, how the JS is included on the page depends on the block developer but you can always do your own overrides to the block controllers if you'd like to.
Also, why this is not and should not be possible from a single setting is that some JS still requires to be in the header. It depends on how the JS is written. Therefore, it should not be possible to "force" all the JS in the footer because some scripts might break that way.
Br,
Antti / Mainio