Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

Replace Joomla Core jQuery Library

Joomla: "UI should be replacement of Joomla core, loaded at component or template level"  Can someone explain to me the best way to go about replacing the Joomla core jQuery UI with another UI?
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robert Granlund

ASKER

@steve is there a way to load my copy of the JS only if it is a certain page that is being used?  Do I need to initialize it or anything?  The reason is that the updated jQuery UI interferes with some of the older scripts in the site and the updated / latest version is only needed on 2 pages.
Yes, but you'd have to use an event, such as onContentPrepare.  Inside your event handler, examine whatever data points you need, then manipulate the document's assigned scripts from there.  You could not use the override method here, since they would be auto-detected and loaded every time.  This also assumes the scripts have been loaded/assigned to the document at some point.

A better alternative is to modify the pages around a single version, and use just that version.  It seems to me you are choosing to hammer your way through a brick wall instead of going through the gate two feet to your left.
@Steve, So the UI should be replacement of Joomla core, loaded at component or template level?
If you need to selectively replace it, you would include the special version with your module.  When you detect the need to execute the replacement, remove the core script reference from the document and replace it with a reference to yours.

If you are going to replace the script wholesale, then you could just drop your version into your template and let Joomla's override system handle it.