businessdad
MVP
Hi again, I need to install an extra jQuery plugin to use it in my Vanilla plugin, and I was wondering what's the recommended place where to put it (it requires some extra CSS, too).
Initially, I thought of putting it in subdirectory of my plugin's directory, but, on the other hand, I might need it again and I'd like not to install it multiple times.
Also, all the examples I found call the "AddJs" somewhere in the initialization, but, this way, the JS file gets loaded in every page, and not only when needed. Is there some sort of "conditional load", or can I freely implement it myself? For example, checking the path and deciding if I should load it or not.
Thanks for the help.
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
Answers
In the past i have used conditions and added it to default.master.php file in my theme, but perhaps there is a cleaner way. Watching this thread
422 Real Estate Australia , now open Check it out
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Pocket plugin can have you but not lot of choices.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Which discussion ?
please, could you give us an example of your code :) thanks in advance
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Try this plugin http://vanillaforums.org/addon/example-plugin
422 Real Estate Australia , now open Check it out
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •in addtion to 422's suggestion on the plugin, you can also
take a look at the embedfriendly theme for an example of how js is added in a theme.
e.g. this is where to hook class.embedfriendlythemehooks.php
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •@442 & @peregrine, it was on my "to do" list :) I will check it out... thank you for your reply
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •http://vanillawiki.homebrewforums.net/index.php/Adding_Some_JQuery_to_a_Plugin
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •