0
Welcome Guest! Login
0 items Join Now

Gantry criteria to load no conflict jQuery

  • Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • Hi all,

      Is there any documentation in the public domain which covers in detail the process of how gantry renders its pages and the elements called in order to do this.

      I have a niggly problem using Gantry5 & Hydrogen where it seems if I add any module to the rendered page either at a "module instance" or a "module position" that jquery and all its pals are immediately loaded by default.

      Its causing problems with a custom module I'm building (I think) and therefore Id like to stop this stuff being loaded so that I can rule it out.

      My problem is I cant work out how to. Whats worse is I cant seem to escape the notion that I'm missing something stupid. Ive never really come across this behaviour before.

      Any pointers appreciated.
    • Do'er of stuff
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 83968
    • Thanks: 10728
    • Web Designer/Developer

    Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • It is Joomla that will load jQuery if it is required. Also, Gantry 5 will also ask Joomla to load it if it is required by a particle or atom. It's fine that jQuery will be loaded. What may be the issue is that your third-party product is loading a second instance of jQuery or even a different version of jQuery. Normally, third-party products have an option to turn off the "load" of jquery (so that they then rely on the version the CMS loads instead).

      No, there is no document that gives you the underlying mechanics of how the Gantry 5 core loads/renders resources.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • Hi Mark,

      Thanks for your reply. Problem is I dont have any third party product.

      I have installed a clean copy of Joomla with only Gantry and Hydrogen

      Ive created an outline layout in which I have deleted everything. All module positions or module instances or anything else is removed.

      I then created a single module position inside which I added a custom html module.

      I added a single character to the custom html module to 'activate' it and ensure it takes its place in the render.

      And because of this the following resources are now loaded:

      <script src="/media/jui/js/jquery.min.js?f203add6aadf0964f467ac96c5865869"></script>
      <script src="/media/jui/js/jquery-noconflict.js?f203add6aadf0964f467ac96c5865869"></script>
      <script src="/media/jui/js/jquery-migrate.min.js?f203add6aadf0964f467ac96c5865869"></script>
      <script src="/media/jui/js/bootstrap.min.js?f203add6aadf0964f467ac96c5865869"></script>

      I dont understand why the minimal amount that I have added has necessitated Gantry to add these lines.
    • Do'er of stuff
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 83968
    • Thanks: 10728
    • Web Designer/Developer

    Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • Please would you post your URL, superuser id and pswd in the secure tab of your post and I'll have a look for you. I'd like to see that page so please tell me the outline number and how to access it.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 83968
    • Thanks: 10728
    • Web Designer/Developer

    Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • I also note that you have now raised an issue on the Gantry 5 project here https://github.com/gantry/gantry5/issues/2501 . I think we should keep the discussion to one place rather than involving lots of people. Where would you prefer to continue?

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • Lets see how this goes first. If no simple answer can come out of this then I think Github is the place for it:

      Secure post imminent
    • Do'er of stuff
  • Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • This message contains only secure information that is visible to Paula Livingstone, moderators and administrators
    • Last Edit: 1 month 2 days ago by Paula Livingstone.
    • Do'er of stuff
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 83968
    • Thanks: 10728
    • Web Designer/Developer

    Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • I think this is a moot point anyway since jQuery and Bootstrap can be loaded at any time by anything else on the page or the CMS itself. There is nothing wrong with them being loaded and they should do no harm. But, you are quite correct that a populated module position or module instance on the layout will indeed cause jQuery and Bootstrap to be loaded. This is because it's likely that both would be required either for the content or to control the structure of the page and/or deal with the viewport size changes when scaling the browser window.

      I have also asked our lead developer about this too, but I anticipate his answer will be much the same and it's unlikely that Gantry 5 would be changed in this regard now as it's been like this since inception and we would not wish to cause any potential adverse effect on existing sites.

      Regards, Mark.

      p.s. if you add a customhtml particle on the layout (rather than using module position or module instance) then that does not load either.
    • Last Edit: 1 month 2 days ago by MrT.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • Ok Mark thanks. I appreciate you taking the time to look at this. My issue was really with instanciating the ability to test without Joomla or Gantry adding the resources that it was.

      Do you agree we should leave the Github case open to cover the follow up you expect and close this off now? Happy either way as Ill get a mail from activity here too if it pops.

      thanks again,

      Paula
    • Do'er of stuff
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 83968
    • Thanks: 10728
    • Web Designer/Developer

    Re: Gantry criteria to load no conflict jQuery

    Posted 1 month 2 days ago
    • Well the way to test you code is either just create a standalone plain html site. OR don't use gantry template - e.g. just use joomla standard template (but they may also load these resouces too).

      You can leave the github ticket... but it would be our lead developer that answers there anyway... so whichever answer comes first I will be aware of and then we can close the other one down.

      Regards, Mark.
    • The following users have thanked you: Paula Livingstone

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.103 seconds