| Page 1 of 2 | [ 13 posts ] | Go to page 1, 2 Next |
|
Hi,
The 'base:' parameter configures the load path for YUI modules. How do I configure the path for gallery modules? Thanks Michael |
|
Michael,
You can either specify the fullpath for the module or if you want to set a base path for a group of modules you'll be using you can put them into a groups object and specify some base params. More info here: http://developer.yahoo.com/yui/3/yui/ - Skip down to the part that says Loader and there is an example of the groups feature I'm talking about |
|
Thanks Lauren,
but when I add to the config object even as much as groups: { gallery: { } } the loader won't load anything at all. It does work when I replace "gallery" (in the above example) with "yui2". In loader.js I see groups.gallery as well ass groups.yui2 however. Could you give an example? Or a link to documentation? If there is any... |
|
I don't have time at the moment to whip up an example but we did have a discussion about this a couple of days ago.
viewtopic.php?f=18&t=3159&p=10790&hilit=groups#p10790 ericf posted a great explanation on how it works. between that and the official ydn docs you should be able to get it up and running. another thing to take note of is that groups was not officially added to the loader until yesterday with 3.1.0 so make sure you're using the latest version hope this helps a little |
|
As Lauren pointed out, you can create a module definition for you gallery module and that definition will be used instead of what is built in. You can also redefine the group definition to pull all gallery modules from another location:
Code: groups: { gallery: { base: '../../../yui3-gallery/build/', patterns: { 'gallery-': {} } } } |
|
Yes, thanks, I figured it out, just beautiful. Unfortunately compared to YUI2 one has to invest significantly more time figuring out the library's source code. Oh well, that's progress(?) I guess
|
|
Hey Michael,
Glad you got it working. I went ahead and put together a pretty extensive demo of using groups inside the loader config. Posting the link here for any others that may need it. http://kickballcreative.com/yui/demos/l ... ig-groups/ |
|
Adding my question to this thread because it's tangentially related. I'd like to set up a group in loader so that I don't have to type out the entire path each time. I'm not combo-handling the files, this is solely to reduce string repetition. Yes, I could do this via a variable but I wanted to learn how the groups stuff works.
My loader groups attemptClick here to see the revision history on this Gist.What am I doing wrong? It should be loading Code: http://localhost/blog/wp-content/themes/arenanet/js/lib/slider-lib.js but instead it's trying to load Code: http://localhost/slider-lib.js |
|
I don't see a base config setting set outside of your groups object.
|
|
Change 'fullpath' to 'path'. Loader resolves the url using either fullpath or base + path.
|
| Page 1 of 2 | [ 13 posts ] | Go to page 1, 2 Next |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group