- Posts: 6
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- K2 js and css loading everywhere - unnecessary and disruptive
K2 js and css loading everywhere - unnecessary and disruptive
- Mark Simpson
- Topic Author
- Offline
- New Member
Less
More
15 years 3 weeks ago #75132
by Mark Simpson
K2 js and css loading everywhere - unnecessary and disruptive was created by Mark Simpson
Hi,
I had trouble deciding where to post this, as it is not a bug and neither is it a feature request in the traditional sense.
I would like to request that you change the way that K2 plugins load css and js; These files should only load on K2 pages and not sitewide.
I know there is no way to make standalone plugins load on selected pages, but this is not the case when the plugins accompany a component.
What are the developers' thoughts on this?
Thank you for your time.
Kind regards,
Mark
I had trouble deciding where to post this, as it is not a bug and neither is it a feature request in the traditional sense.
I would like to request that you change the way that K2 plugins load css and js; These files should only load on K2 pages and not sitewide.
I know there is no way to make standalone plugins load on selected pages, but this is not the case when the plugins accompany a component.
What are the developers' thoughts on this?
Thank you for your time.
Kind regards,
Mark
Please Log in or Create an account to join the conversation.
- bunglehaze
- Offline
- Elite Member
Less
More
- Posts: 168
15 years 3 weeks ago #75133
by bunglehaze
Replied by bunglehaze on topic K2 js and css loading everywhere - unnecessary and disruptive
Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice.
leigh
leigh
Please Log in or Create an account to join the conversation.
- Mark Simpson
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
15 years 3 weeks ago #75134
by Mark Simpson
Replied by Mark Simpson on topic K2 js and css loading everywhere - unnecessary and disruptive
Hi bunglehaze,
Thanks for the comment.
I'm sorry if I wasn't clear. I don't have the issue you mention. K2 works as it is meant to for me; mine is not a bug report (your issue certainly sounds like a bug).
I have provided all the info I need to.
K2 requires one or more js and css files. It loads this to the < head >.
My complaint is that this is done site-wide. If I have a 1000 page website, and only one page uses K2, every single one of those 1000 pages loads the K2 js and css files. This is inefficient, unnecessary, and undesirable, hence my post.
Kind regards
-m
bunglehaze said:Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice. leigh
Thanks for the comment.
I'm sorry if I wasn't clear. I don't have the issue you mention. K2 works as it is meant to for me; mine is not a bug report (your issue certainly sounds like a bug).
I have provided all the info I need to.
K2 requires one or more js and css files. It loads this to the < head >.
My complaint is that this is done site-wide. If I have a 1000 page website, and only one page uses K2, every single one of those 1000 pages loads the K2 js and css files. This is inefficient, unnecessary, and undesirable, hence my post.
Kind regards
-m
bunglehaze said:Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice. leigh
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
15 years 3 weeks ago #75135
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 js and css loading everywhere - unnecessary and disruptive
Including one css and one js file with K2 sitewide was a necessary decision for various reasons, the most important being:
- Joomla's cache does not behave properly with modules meaning it cannot display attached css/js code using the API
- having the above reason in mind we cannot have module css/js rendered only for the modules (through some system plugin) cause we cannot determine where they appear. E.g. you can have some K2 modules on your site's frontpage yet not have the K2 component.
- deciding to load 1 css and 1 js file is actually good in terms of performance cause it's the bare minimum, plus the browser will cache these 2 files on the first page load. If you add to that the built in templating features of K2 you can disable the css include with the flip of a switch in the component params.
And to clarify one thing you said, the browser does NOT reload these two files AFTER the first page load.
K2 is a professional content tool and it's built with performance and flexibility in mind. ;)Mark Simpson said:Hi bunglehaze,
Thanks for the comment.
I'm sorry if I wasn't clear. I don't have the issue you mention. K2 works as it is meant to for me; mine is not a bug report (your issue certainly sounds like a bug).
I have provided all the info I need to.
K2 requires one or more js and css files. It loads this to the < head >.
My complaint is that this is done site-wide. If I have a 1000 page website, and only one page uses K2, every single one of those 1000 pages loads the K2 js and css files. This is inefficient, unnecessary, and undesirable, hence my post.
Kind regards
-m
bunglehaze said:Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice. leigh
- Joomla's cache does not behave properly with modules meaning it cannot display attached css/js code using the API
- having the above reason in mind we cannot have module css/js rendered only for the modules (through some system plugin) cause we cannot determine where they appear. E.g. you can have some K2 modules on your site's frontpage yet not have the K2 component.
- deciding to load 1 css and 1 js file is actually good in terms of performance cause it's the bare minimum, plus the browser will cache these 2 files on the first page load. If you add to that the built in templating features of K2 you can disable the css include with the flip of a switch in the component params.
And to clarify one thing you said, the browser does NOT reload these two files AFTER the first page load.
K2 is a professional content tool and it's built with performance and flexibility in mind. ;)Mark Simpson said:Hi bunglehaze,
Thanks for the comment.
I'm sorry if I wasn't clear. I don't have the issue you mention. K2 works as it is meant to for me; mine is not a bug report (your issue certainly sounds like a bug).
I have provided all the info I need to.
K2 requires one or more js and css files. It loads this to the < head >.
My complaint is that this is done site-wide. If I have a 1000 page website, and only one page uses K2, every single one of those 1000 pages loads the K2 js and css files. This is inefficient, unnecessary, and undesirable, hence my post.
Kind regards
-m
bunglehaze said:Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice. leigh
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Mark Simpson
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
15 years 3 weeks ago #75136
by Mark Simpson
Replied by Mark Simpson on topic K2 js and css loading everywhere - unnecessary and disruptive
That makes sense. I never thought of the modules.
I know that the CSS and JS files are cached and would only be downloaded once; I meant many visitors to my website will be downloading the K2 files (once) even if they never land on a page with any K2 on it.
Once again, a Joomla limitation has us by the balls.
Anyway, thank you for taking the time to post a detailed response Fotis, I appreciate it.
I'm a big fan of K2, and though I've found the odd annoyance, I'm sure it will only get better as it matures :)
JoomlaWorks said:Including one css and one js file with K2 sitewide was a necessary decision for various reasons, the most important being: - Joomla's cache does not behave properly with modules meaning it cannot display attached css/js code using the API - having the above reason in mind we cannot have module css/js rendered only for the modules (through some system plugin) cause we cannot determine where they appear. E.g. you can have some K2 modules on your site's frontpage yet not have the K2 component.
- deciding to load 1 css and 1 js file is actually good in terms of performance cause it's the bare minimum, plus the browser will cache these 2 files on the first page load. If you add to that the built in templating features of K2 you can disable the css include with the flip of a switch in the component params.
And to clarify one thing you said, the browser does NOT reload these two files AFTER the first page load.
K2 is a professional content tool and it's built with performance and flexibility in mind. ;)Mark Simpson said:Hi bunglehaze, Thanks for the comment.
I'm sorry if I wasn't clear. I don't have the issue you mention. K2 works as it is meant to for me; mine is not a bug report (your issue certainly sounds like a bug).
I have provided all the info I need to.
K2 requires one or more js and css files. It loads this to the < head >.
My complaint is that this is done site-wide. If I have a 1000 page website, and only one page uses K2, every single one of those 1000 pages loads the K2 js and css files. This is inefficient, unnecessary, and undesirable, hence my post.
Kind regards
-m
bunglehaze said:Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice. leigh
I know that the CSS and JS files are cached and would only be downloaded once; I meant many visitors to my website will be downloading the K2 files (once) even if they never land on a page with any K2 on it.
Once again, a Joomla limitation has us by the balls.
Anyway, thank you for taking the time to post a detailed response Fotis, I appreciate it.
I'm a big fan of K2, and though I've found the odd annoyance, I'm sure it will only get better as it matures :)
JoomlaWorks said:Including one css and one js file with K2 sitewide was a necessary decision for various reasons, the most important being: - Joomla's cache does not behave properly with modules meaning it cannot display attached css/js code using the API - having the above reason in mind we cannot have module css/js rendered only for the modules (through some system plugin) cause we cannot determine where they appear. E.g. you can have some K2 modules on your site's frontpage yet not have the K2 component.
- deciding to load 1 css and 1 js file is actually good in terms of performance cause it's the bare minimum, plus the browser will cache these 2 files on the first page load. If you add to that the built in templating features of K2 you can disable the css include with the flip of a switch in the component params.
And to clarify one thing you said, the browser does NOT reload these two files AFTER the first page load.
K2 is a professional content tool and it's built with performance and flexibility in mind. ;)Mark Simpson said:Hi bunglehaze, Thanks for the comment.
I'm sorry if I wasn't clear. I don't have the issue you mention. K2 works as it is meant to for me; mine is not a bug report (your issue certainly sounds like a bug).
I have provided all the info I need to.
K2 requires one or more js and css files. It loads this to the < head >.
My complaint is that this is done site-wide. If I have a 1000 page website, and only one page uses K2, every single one of those 1000 pages loads the K2 js and css files. This is inefficient, unnecessary, and undesirable, hence my post.
Kind regards
-m
bunglehaze said:Mark, what other components are you using? I had a very similar issue with a couple of components dragging through K2 articles, I also had conflicts in js that caused it. You need to feed back more if you expect one of the devs or community to be able to dig in and offer advice. leigh
Please Log in or Create an account to join the conversation.
- Terp
- Offline
- New Member
Less
More
- Posts: 10
15 years 2 weeks ago #75137
by Terp
Replied by Terp on topic K2 js and css loading everywhere - unnecessary and disruptive
Hey, mark, thought of you when that storm hit 'the island' the other day...and should have known that you would beat me to the punch:
k2community.joomlaworks.gr/forum/topics/calling-50k-of-k2-js-and-css
I didn't even create a menu item yet, so zero K2 content on the site, and I noticed this just after installation.... :(
I can live with the small js file and the squeezebox stuff in the source, so may try to use a different css file that gets loaded only on the page with k2 content, if that is possible...since no k2 content/tools anywhere else on the site.
k2community.joomlaworks.gr/forum/topics/calling-50k-of-k2-js-and-css
I didn't even create a menu item yet, so zero K2 content on the site, and I noticed this just after installation.... :(
I can live with the small js file and the squeezebox stuff in the source, so may try to use a different css file that gets loaded only on the page with k2 content, if that is possible...since no k2 content/tools anywhere else on the site.
Please Log in or Create an account to join the conversation.
- Mark Simpson
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
15 years 2 weeks ago #75138
by Mark Simpson
Replied by Mark Simpson on topic K2 js and css loading everywhere - unnecessary and disruptive
Hey Terp,
Good to see you here :)
I haven't gotten around to it but I'll be stripping out the JS and using one of our extensions to stick it back into pages that need it.
Terp said:Hey, mark, thought of you when that storm hit 'the island' the other day...and should have known that you would beat me to the punch:
k2community.joomlaworks.gr/forum/topics/calling-50k-of-k2-js...
I didn't even create a menu item yet, so zero K2 content on the site, and I noticed this just after installation.... :(
I can live with the small js file and the squeezebox stuff in the source, so may try to use a different css file that gets loaded only on the page with k2 content, if that is possible...since no k2 content/tools anywhere else on the site.
Good to see you here :)
I haven't gotten around to it but I'll be stripping out the JS and using one of our extensions to stick it back into pages that need it.
Terp said:Hey, mark, thought of you when that storm hit 'the island' the other day...and should have known that you would beat me to the punch:
k2community.joomlaworks.gr/forum/topics/calling-50k-of-k2-js...
I didn't even create a menu item yet, so zero K2 content on the site, and I noticed this just after installation.... :(
I can live with the small js file and the squeezebox stuff in the source, so may try to use a different css file that gets loaded only on the page with k2 content, if that is possible...since no k2 content/tools anywhere else on the site.
Please Log in or Create an account to join the conversation.
- James Durrant
- Offline
- New Member
Less
More
- Posts: 9
15 years 1 week ago #75139
by James Durrant
Replied by James Durrant on topic K2 js and css loading everywhere - unnecessary and disruptive
Hey,
Does anyone know what files in K2 call:
modal.css
SqueezeBox.initialize({});
var K2RatingURL
I'm going to be using GTranslate which runs on JQuery, so I'm removing all the Mootools JS and converting the elements I need to Jquery to save code bloat.
Cheers,
Does anyone know what files in K2 call:
modal.css
SqueezeBox.initialize({});
var K2RatingURL
I'm going to be using GTranslate which runs on JQuery, so I'm removing all the Mootools JS and converting the elements I need to Jquery to save code bloat.
Cheers,
Please Log in or Create an account to join the conversation.
- rexkramer
- Offline
- Senior Member
Less
More
- Posts: 71
14 years 6 months ago #75140
by rexkramer
Replied by rexkramer on topic K2 js and css loading everywhere - unnecessary and disruptive
Older thread... but i stumbled over this little system plugin. Maybe its useful for someone:
Custom Head Tag
extensions.joomla.org/extensions/style-a-design/templating/4179
developer:
translate.google.de/translate?js=y&prev=_t&hl=de&ie=UTF-8&layout=1&eotf=1&u=http%3A%2F%2Fwww.joomler.net%2Fextensions%2F43-custom-head-tag.html&sl=auto&tl=en
Custom Head Tag
extensions.joomla.org/extensions/style-a-design/templating/4179
developer:
translate.google.de/translate?js=y&prev=_t&hl=de&ie=UTF-8&layout=1&eotf=1&u=http%3A%2F%2Fwww.joomler.net%2Fextensions%2F43-custom-head-tag.html&sl=auto&tl=en
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- K2 js and css loading everywhere - unnecessary and disruptive