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

Option to disable jQuery #88

Open
mediaclinic opened this issue Mar 1, 2015 · 1 comment
Open

Option to disable jQuery #88

mediaclinic opened this issue Mar 1, 2015 · 1 comment

Comments

@mediaclinic
Copy link

Is there an option to disable jQuery loading from Swipestripe? That would be a great option in YML, as your theme might already use it and you want to load it only once.

@Zauberfisch
Copy link
Contributor

A mechanism for this already exists in SilverStripe. you can block resources.

Requirements::block(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::block(THIRDPARTY_DIR . '/jquery/jquery.min.js'); 

with block you can block certain files from being added. you can pretty much put those 2 lines anywhere, can be before or after the code of SilverStripe is executed.
Though I would advise to put it into the init() method of the page controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants