Keyword

[SOLVED] How to Unset K2.js File?

  • Mr_Anonymous
  • Mr_Anonymous's Avatar Topic Author
  • Offline
  • Premium Member
More
9 years 3 months ago - 9 years 3 months ago #136162 by Mr_Anonymous
How to Unset K2.js File? was created by Mr_Anonymous
I am trying to remove the k2.js file from my template so I can add that directly to my site javascript. What is the best way I can achieve this? I tried adding unset to my template's index.php file but this is not working:
unset($this->_scripts['/components/com_k2/js/k2.js']);

Also, I noticed that the k2.js has url like this:
/components/com_k2/js/k2.js?v2.6.8&sitepath=/

Why does it have all that extra info after '?'

This url is preventing mod_pagespeed from minifying, combining and caching k2.js files. Thats why I am trying to merge that with my site js and remove the k2.js from loading separately. Can you guide me here please?

I am using Joomla 3.3.6 with K2 2.6.9
Last edit: 9 years 3 months ago by Mr_Anonymous.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #136189 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to Unset K2.js File?

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

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

  • Mr_Anonymous
  • Mr_Anonymous's Avatar Topic Author
  • Offline
  • Premium Member
More
9 years 3 months ago #136230 by Mr_Anonymous
Replied by Mr_Anonymous on topic How to Unset K2.js File?
Perfect. thanks for that link. I found that topic mentioned somewhere else but couldnt get to the link. It kept taking me to advanced search page. This link you had posted now works and it answers my question.

Cheers :)
Neel.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #136239 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to Unset K2.js File?
You 're welcome Neel :)

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

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

  • Mr_Anonymous
  • Mr_Anonymous's Avatar Topic Author
  • Offline
  • Premium Member
More
9 years 3 months ago - 9 years 3 months ago #136273 by Mr_Anonymous
Replied by Mr_Anonymous on topic How to Unset K2.js File?
For the completion of this thread, this is what I am using for v2.6.9:
unset($this->_scripts[JURI::root(true).'/components/com_k2/js/k2.js?v2.6.9&sitepath='.JURI::root(true).'/']);
Last edit: 9 years 3 months ago by Mr_Anonymous.

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


Powered by Kunena Forum