Keyword

Only load K2 assets when the component / module is used

  • Uzi
  • Uzi's Avatar Topic Author
  • Offline
  • Premium Member
More
1 year 10 months ago - 1 year 10 months ago #180632 by Uzi
I'd like to disable K2 to load its assets on pages where the component is not used. For example on my homepage it seems that it loads the k2 assets for js and css files. I'd like to disable that. How is that possible?
Last edit: 1 year 10 months ago by Uzi.

Please Log in or Create an account to join the conversation.

  • Uzi
  • Uzi's Avatar Topic Author
  • Offline
  • Premium Member
More
1 year 10 months ago #180652 by Uzi
/administrator/components/com_k2/helpers/html.php

on line 434

if($option == 'com_k2'){

}

I wrapped the code of adding the js and styles into this if statement to only load the stuff when the component is k2

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #180657 by JoomlaWorks
It's not as simple because the modules may use some of that code.

But I can assure you this feature is planned for the near future.

The greater plan is to ditch jQuery overall in the frontend, load vanilla JS in inline snippets (and only where needed) & ditch any font icons in favour of inline SVG icons. K2's main CSS is already flexible so it's not an issue.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum