Keyword

Disable loading of magnific-popup and simple-line-icons

  • WinniePooh
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
6 years 7 months ago #163532 by WinniePooh
Hello,

with the new 2.8 update of K2 (thank you for this one) I've noticed that K2 loads the CSS files magnific-popup.min.css and simple-line-icons.min.css from a CDN. Why needs the files to be loaded? I'm using a template override, so I can't see any changes. How can I disable the loading of these files?

Regards

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 7 months ago #163554 by Krikor Boghossian
Replied by Krikor Boghossian on topic Disable loading of magnific-popup and simple-line-icons
You can alter some core files to remove the lightbox but since it is bound with frontend editing, this can lead to unexpected behaviour and some JS issues. I would not recommend performing such actions.

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

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

  • 野草工作室
  • 野草工作室's Avatar
  • Offline
  • New Member
  • 专业Joomla建站
More
6 years 2 months ago #166503 by 野草工作室
Replied by 野草工作室 on topic Disable loading of magnific-popup and simple-line-icons

Krikor wrote: You can alter some core files to remove the lightbox but since it is bound with frontend editing, this can lead to unexpected behaviour and some JS issues. I would not recommend performing such actions.


Why does K2 load more and more of these CDN resources? And can not switch to localhost resources?
I come from China, when we use K2, because of the need to load these CDNs, causing K2 to run very slowly ...

I know using CDN is to some extent to speed up loading, but for some areas may be the opposite,
Hope later updated version, at least to switch localhost load, so that can meet the needs of different situations

thank you very much

野草工作室提供专业Joomla建站服务
www.ycway.com

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

More
6 years 2 months ago #166574 by Eddie Hamasaki
Replied by Eddie Hamasaki on topic Disable loading of magnific-popup and simple-line-icons
I have this same issue
Krikor said "You can alter some core files to remove the lightbox but since it is bound with frontend editing, this can lead to unexpected behaviour and some JS issues. I would not recommend performing such actions."

Im not using frontend editing, I even disabled it
What core files should I edit to remove magnific and simple line icons?

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

  • 野草工作室
  • 野草工作室's Avatar
  • Offline
  • New Member
  • 专业Joomla建站
More
6 years 2 months ago - 6 years 2 months ago #166583 by 野草工作室
Replied by 野草工作室 on topic Disable loading of magnific-popup and simple-line-icons
You can try to modify this file,
administrator/components/com_k2/helpers/html.php
Find the relevant load file and comment it

E.g
$document->addStyleSheet('https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css');
Modified as such
//$document->addStyleSheet('https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css');

野草工作室提供专业Joomla建站服务
www.ycway.com
Last edit: 6 years 2 months ago by 野草工作室.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 2 months ago #166637 by Krikor Boghossian
Replied by Krikor Boghossian on topic Disable loading of magnific-popup and simple-line-icons
I would recommend moving this file into your local installation and change the path instead of not loading it at all.

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

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

More
5 years 8 months ago - 5 years 8 months ago #168636 by Jean Machuron
I agree that you should provide the ability to choose loading from local or cloud for all the outside files
That's also a problem for minification and provides lots of js errors
Last edit: 5 years 8 months ago by Jean Machuron.

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

More
5 years 8 months ago #168642 by Nadal Kumar
Instead of editing a core file which will be ovewritten on updates, use one of the following:

- Create a simple system plugin and use php unset method within the onBeforeCompileHead() function.
- Install one of the many plugins that already has a method to unset and script. 2 that are popular are JCHOptimize and Jquery Easy

Plugin code
class plgSystemUnsetScripts extends JPlugin 
{
public function onBeforeCompileHead() 
{
if( JFactory::getApplication()->isAdmin() ) { return;}
$head = JFactory::getDocument()->getHeadData();
			
unset($head['styleSheets']['https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css']);
JFactory::getDocument()->setHeadData($head);
	
}
}

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


Powered by Kunena Forum