Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems including scripts #22

Open
kernusr opened this issue Apr 27, 2020 · 5 comments
Open

Problems including scripts #22

kernusr opened this issue Apr 27, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@kernusr
Copy link

kernusr commented Apr 27, 2020

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
Copy link
Author

kernusr commented Apr 27, 2020

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
Copy link
Member

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

@chetanmadaan chetanmadaan added the bug Something isn't working label Apr 27, 2020
@kernusr
Copy link
Author

kernusr commented Apr 28, 2020

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
Copy link
Author

kernusr commented Apr 28, 2020

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

@kernusr kernusr changed the title Problems connecting scripts Problems including scripts Apr 28, 2020
@chetanmadaan
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants