We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14344
    • 16 Posts
    Is it possible to run a Jquery script inside a modx resource?

    I have a gallery I want displayed using a jquery script, but if I use a Modx resource the script doesn’t work. If I create a static html pages it works fine.
      • 9102 ☆ A M B ☆
      • 318 Posts
      Yes, definitely. Your output from MODx should just be straight, normal HTML so I don’t see any reason jquery wouldn’t work -- I use it for several things and it works fine.

      It seems like there must be some difference between the code being output by MODx and the code on your static page. Perhaps if you can identify the difference it could be fixed?
        • 14344
        • 16 Posts
        fr33jung, Thanks for the fast reply. Unfortunately for me after looking at my coding again I found the problem. I had a mistyped character in my url to the css side of the script. Guess Next time I will have to take a break and then post on the forums if I still haven’t figured it out by then. Now all I have to do is figure out how to make the gallery plugin populate the script. Thanks again!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          While I’m not familiar with Revo’s gallery management offerings, they should all have the ability to use a custom mini-template (tpl) to control their output. What I always do is first hard-code the sample that comes with the JQuery script to make sure I can get it working properly. Then I use the structure needed as the basis for the gallery’s tpl. It usually goes pretty seamlessly.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org