joomdev / JD-Builder

JD Builder - Experience the Next Generation of Joomla Page Builder.
https://www.joomdev.com/jd-builder
GNU General Public License v3.0
22 stars 16 forks source link

Problems including scripts #22

Open kernusr opened 4 years ago

kernusr commented 4 years ago

When I embed a JDBuilder module in a page, it connects jquery and noconflict after loading scripts from a template. It breaks the work with bootstrap Because jquery library must be connected before the bootstrap script sss

kernusr commented 4 years ago

Why do not you load jquery and bootstrap, as a library, in your ecosystem for templates, modules and builder? Something similar to \Joomla\CMS\HTML\HTMLHelper::_('jd.jquery); \Joomla\CMS\HTML\HTMLHelper::_('jd.bootstrap); This will check the connection of libraries and eliminate duplication of them in the code

chetanmadaan commented 4 years ago

Hi @kernusr this is a known issue we are working to fix.

  1. Only included jQuery if a element being used on the page needs it.
  2. Remove all jQuery dependcy form elements including Slider and others.
  3. Try to use Joomla jQuery where required.

For the moment you can comment it the following file to avoid the conflict. https://github.com/joomdev/JD-Builder/blob/master/plg_jdbuilder/libraries/jdpagebuilder/Builder.php#L909-L910

kernusr commented 4 years ago

Well, I can always comment on the code But what do you think about packing bootstrap and jgery in a separate library that you will use in all your extensions Here is an example of code that installs the library separately from the package. This code can be used in all extensions to check and install dependencies https://github.com/Quantum-Manager/pkg_quantummanager/blob/master/script.php#L214

An example of how to pack a library for a joomla can be found in this project https://github.com/master3-blank-template/UIkit3-Joomla-library The author made a uikit as a joomla library and sets it as a dependency for his template

kernusr commented 4 years ago

Maybe you discuss this option and I can help you? I can prepare PR, but I must know that you will accept it, so as not to waste time

chetanmadaan commented 4 years ago

Thank you... These are very helpful and like I said, we already have the plan to fix it in the near future.

I don't know the full details about how the code would be written so, I'd recommend not working on the PR. But, I'll post back once we have this done and have you take a second look at it.