[ 13 posts ] Go to page 1, 2 Next

Michael Hasenstein

  • Username: hasenstein
  • Joined: Fri Mar 20, 2009 7:22 am
  • Posts: 91
  • Location: Nuernberg, Germany
  • Offline
  • Profile

Configure load path for gallery modules?

Post Posted: Thu Apr 01, 2010 1:21 am
+0-
Hi,

The 'base:' parameter configures the load path for YUI modules. How do I configure the path for gallery modules?

Thanks
Michael

Lauren Smith

YUI Contributor

  • Username: kickballcreative
  • Joined: Mon Mar 08, 2010 7:13 am
  • Posts: 36
  • Location: Tulsa, OK
  • Twitter: isfinite
  • GitHub: isfinite
  • Gists: isfinite
  • IRC: isfinite
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Thu Apr 01, 2010 4:53 am
+0-
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

Michael Hasenstein

  • Username: hasenstein
  • Joined: Fri Mar 20, 2009 7:22 am
  • Posts: 91
  • Location: Nuernberg, Germany
  • Offline
  • Profile
Tags:

Re: Configure load path for gallery modules?

Post Posted: Thu Apr 01, 2010 5:37 am
+0-
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...

Lauren Smith

YUI Contributor

  • Username: kickballcreative
  • Joined: Mon Mar 08, 2010 7:13 am
  • Posts: 36
  • Location: Tulsa, OK
  • Twitter: isfinite
  • GitHub: isfinite
  • Gists: isfinite
  • IRC: isfinite
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Thu Apr 01, 2010 6:15 am
+0-
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

Adam Moore

YUI Contributor

  • Username: adam
  • Joined: Wed Sep 03, 2008 11:16 am
  • Posts: 356
  • GitHub: apm
  • Gists: apm
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Thu Apr 01, 2010 10:34 am
+0-
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-': {} }
                }
            }

Michael Hasenstein

  • Username: hasenstein
  • Joined: Fri Mar 20, 2009 7:22 am
  • Posts: 91
  • Location: Nuernberg, Germany
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Thu Apr 01, 2010 11:08 am
+0-
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 ;-) (okay, there's a lot more infrastructure now, I love it)

Lauren Smith

YUI Contributor

  • Username: kickballcreative
  • Joined: Mon Mar 08, 2010 7:13 am
  • Posts: 36
  • Location: Tulsa, OK
  • Twitter: isfinite
  • GitHub: isfinite
  • Gists: isfinite
  • IRC: isfinite
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Fri Apr 02, 2010 7:26 am
+0-
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/

Patrick Cavit

YUI Contributor

  • Username: Tivac
  • Joined: Mon Jan 26, 2009 4:03 pm
  • Posts: 37
  • Twitter: tivac
  • GitHub: tivac
  • Gists: tivac
  • IRC: tivac
  • Offline
  • Profile
Tags:

Re: Configure load path for gallery modules?

Post Posted: Tue Apr 06, 2010 10:14 pm
+0-
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 attempt

Click 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

Lauren Smith

YUI Contributor

  • Username: kickballcreative
  • Joined: Mon Mar 08, 2010 7:13 am
  • Posts: 36
  • Location: Tulsa, OK
  • Twitter: isfinite
  • GitHub: isfinite
  • Gists: isfinite
  • IRC: isfinite
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Tue Apr 06, 2010 11:01 pm
+0-
I don't see a base config setting set outside of your groups object.

Adam Moore

YUI Contributor

  • Username: adam
  • Joined: Wed Sep 03, 2008 11:16 am
  • Posts: 356
  • GitHub: apm
  • Gists: apm
  • Offline
  • Profile

Re: Configure load path for gallery modules?

Post Posted: Wed Apr 07, 2010 7:46 am
+0-
Change 'fullpath' to 'path'. Loader resolves the url using either fullpath or base + path.
  [ 13 posts ] Go to page 1, 2 Next
Display posts from previous:  Sort by  
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