From diwaker.lists at gmail.com Mon May 22 03:19:29 2006 From: diwaker.lists at gmail.com (Diwaker Gupta) Date: Mon, 22 May 2006 00:19:29 -0700 Subject: [webgen-users] Creating a new gallery layout Message-ID: <891be9410605220019sd3c4135q941d075b732652be@mail.gmail.com> Hi, I'm trying to create a new gallery layout. I did the following: o create plugin/foobar.rb in my base directory. o copy plugins/gallerylayouters/default.rb in foobar.rb and make appropriate modifications. For simplicity, lets say my class looks thus: require 'webgen/plugins/gallerylayouters/default' module GalleryLayouters class Foobar < DefaultGalleryLayouter define_handler 'layout' register_layout 'foobar' end end (yes, I tried filling in the main, gallery and image methods. Same results) o I create a file my.gallery under src/: title: Gallery files: gallery/**/*.jpg imagesPerPage: 16 layout: "foobar" mainPage: inMenu: true Now when I run webgen, I keep getting lots of these: Mon May 22 00:17:23 PDT 2006 ERROR -- Invalid layout specified: foobar! Using GalleryLayouters::DefaultGalleryLayouter!: Verbose logging shows me this: Mon May 22 00:19:04 PDT 2006 DEBUG -- Loading plugin file ...: Mon May 22 00:19:04 PDT 2006 INFO -- Registering class GalleryLayouters::Foobar for handling layout 'foobar': What am I missing? Thanks Diwaker -- Web/Blog/Gallery: http://floatingsun.net/blog From diwaker.lists at gmail.com Mon May 22 16:32:41 2006 From: diwaker.lists at gmail.com (Diwaker Gupta) Date: Mon, 22 May 2006 13:32:41 -0700 Subject: [webgen-users] Creating a new gallery layout In-Reply-To: <891be9410605220019sd3c4135q941d075b732652be@mail.gmail.com> References: <891be9410605220019sd3c4135q941d075b732652be@mail.gmail.com> Message-ID: <891be9410605221332y79c2736dqcc6547c5e1d47694@mail.gmail.com> Sorry for the self-reply, but I figured it out: > module GalleryLayouters > class Foobar < DefaultGalleryLayouter > define_handler 'layout' <== DON'T NEED THIS!! > register_layout 'foobar' > end > end But it wasn't apparent from the documentation. I had to read through plugin.rb to figure out what was going on. Diwaker -- Web/Blog/Gallery: http://floatingsun.net/blog From t_leitner at gmx.at Tue May 23 08:51:12 2006 From: t_leitner at gmx.at (Thomas Leitner) Date: Tue, 23 May 2006 14:51:12 +0200 Subject: [webgen-users] Creating a new gallery layout In-Reply-To: <891be9410605221332y79c2736dqcc6547c5e1d47694@mail.gmail.com> References: <891be9410605220019sd3c4135q941d075b732652be@mail.gmail.com> <891be9410605221332y79c2736dqcc6547c5e1d47694@mail.gmail.com> Message-ID: <20060523145112.24daceb6@localhost> On Mon, 22 May 2006 13:32:41 -0700 "Diwaker Gupta" wrote: | Sorry for the self-reply, but I figured it out: | | > module GalleryLayouters | > class Foobar < DefaultGalleryLayouter | > define_handler 'layout' <== DON'T NEED THIS!! | > register_layout 'foobar' | > end | > end | | But it wasn't apparent from the documentation. I had to read through | plugin.rb to figure out what was going on. I know, some parts of the documentation are not really good, but I currently lack the time to work on webgen. I hope it will get better soon and then I will update the docs on webgen.rubyforge.org. Thomas