# Help with Gallery Extension

**URL:** <https://www.ruby-forum.com/t/help-with-gallery-extension/118751>\
**Category:** Radiant CMS\
**Created:** [October 30, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751 "2007-10-30T17:26:50Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 30, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/1 "2007-10-30T17:26:50Z")

</div>

I have installed the Gallery Extension, but am not sure how to get  
started. I’ve read the README in rdoc, and have search through this  
lists’ archives, but have not found a simple example that shows how  
to create a new gallery so I can upload images.

Will someone please help?

Thanks,  
Phillip

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 9:45am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/2 "2007-10-31T09:45:35Z")

</div>

If i remember correctly when you do rake  
radiant:extensions:gallery:install you should have two new default  
pages with a sample gallery.

If you don’t you can create a new page and check the available tags.  
To upload files you should use the new tabs available in the admin  
console.

2007/10/30, Phillip K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 10:38am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/3 "2007-10-31T10:38:47Z")

</div>

On 10/31/07, Giovanni I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> If i remember correctly when you do rake  
> radiant:extensions:gallery:install you should have two new default  
> pages with a sample gallery.

It should be work with the command above…then you can find some  
example under the layouts folder…let me know 🙂

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/4 "2007-10-31T14:02:30Z")

</div>

> As I’m working with galleries adding images and such, is there some  
> easy way to get back to the Radiant admin home panel? Is Back all  
> there is?

You can click on the pages Tab

> Potential problem(s):
> 
> I’m getting some Javascript errors when I go into Galleries off the  
> Radiant admin panel. With one gallery defined, I get these two errors  
> (reported in Firebug):

Which version of prototype are you using?

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 1:54pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/5 "2007-10-31T13:54:15Z")

</div>

Giovanni / Andrea

Thanks for the help. I had overlooked the Gallery tab in the admin  
interface. That was the part that befuddled me: how to create a new  
gallery and upload images. Got it now.

Another question:

As I’m working with galleries adding images and such, is there some  
easy way to get back to the Radiant admin home panel? Is Back all  
there is?

Potential problem(s):

I’m getting some Javascript errors when I go into Galleries off the  
Radiant admin panel. With one gallery defined, I get these two errors  
(reported in Firebug):

- gallery\_tree has no properties  
gallery\_tree.createItem(1, null);  
gallery (line 46)

- GalleryTree is not defined  
var gallery\_tree = new GalleryTree ({  
gallery (line 3)

When clicking on the one gallery to view it, I get this error:

- GallerySortableList is not defined  
GallerySortableList.create(‘list’, …  
1 (line 51)

Clicking on the edit link of the one image in my gallery produces no  
result and this error:

- GalleryItemPopup is not defined  
1 (line 1)

And finally, clicking on the “Switch to url mode” link produces this  
error

- Gallery is not defined  
1 (line 1)

I’m using:  
Firefox 2.0.0.8 on Mac OS X 10.4  
Radiant 0.6.2 (gem)  
Gallery 0.6.3  
on Dreamhost (if it matters)

Also, the /admin/gallery page is without style. Is that how it’s  
supposed to be? Using Firebug, I was looking for CSS that might be  
loading, and it does not appear to be loading any. Since this is a  
page off of the admin panel, I’m not sure if there’s anything that I  
need to do to make it work correctly.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 2:57pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/6 "2007-10-31T14:57:01Z")

</div>

Hi Andrea,

On Oct 31, 2007, at 8:01 AM, Andrea F. wrote:

> > As I’m working with galleries adding images and such, is there some  
> > easy way to get back to the Radiant admin home panel? Is Back all  
> > there is?
> 
> You can click on the pages Tab

There isn’t a Pages tab. The Radiant Admin styling isn’t there.  
Maybe it’s related to some other problem?

> > Potential problem(s):
> > 
> > I’m getting some Javascript errors when I go into Galleries off the  
> > Radiant admin panel. With one gallery defined, I get these two errors  
> > (reported in Firebug):
> 
> Which version of prototype are you using?

After I sent the message before, I thought, “Oh, I should have  
included the Prototype version.” Heh heh. 1.5.0\_rc2. I suppose  
that is the version that is provided by Dreamhost’s rails install.  
Hmm… not sure where the rc\_2 came from. I just created a new rails  
app to check the default prototype, and it’s 1.5.0, which is coming  
from rails 1.2.3.

Which version of Prototype do you suggest I use?

Thanks,  
Phillip

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/7 "2007-10-31T15:59:08Z")

</div>

> After I sent the message before, I thought, “Oh, I should have  
> included the Prototype version.” Heh heh. 1.5.0\_rc2. I suppose  
> that is the version that is provided by Dreamhost’s rails install.  
> Hmm… not sure where the rc\_2 came from. I just created a new rails  
> app to check the default prototype, and it’s 1.5.0, which is coming  
> from rails 1.2.3.

I’ve just installed radiant from gem 0.6.3, and the gallery extension  
0.6.3 (the same version 😛 ) and all work fine…can you try with  
these versions?

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/8 "2007-10-31T22:51:49Z")

</div>

Thanks for testing, Andrea. Unfortunately, I’ve not been able to  
upgrade to Radiant 0.6.3 on DreamHost. I’ve been trying off and on  
all day and the process gets killed every time. Might you have some  
other suggestion that I can try? I did give Prototype 1.5.1.1 a  
shot, but that resulted in 14000+ Javascript errors (which I believe  
is due to a mismatch between Prototype and Scriptaculous…I’ve  
encountered that before).

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [October 31, 2007, 11:29pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/9 "2007-10-31T23:29:51Z")

</div>

On 10/31/07, Phillip K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks for testing, Andrea. Unfortunately, I’ve not been able to  
> upgrade to Radiant 0.6.3 on DreamHost. I’ve been trying off and on  
> all day and the process gets killed every time. Might you have some  
> other suggestion that I can try? I did give Prototype 1.5.1.1 a  
> shot, but that resulted in 14000+ Javascript errors (which I believe  
> is due to a mismatch between Prototype and Scriptaculous…I’ve  
> encountered that before).

Yo Philip, I have an instance of radiant 0.6.2 here:

[http://gor.bigchieflabs.com/demo](http://gor.bigchieflabs.com/demo)

with prototype 1.5.0\_rc2…and all works…it’s very strange…I’ll  
try again tomorrow 🙂

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 1, 2007, 11:25am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/10 "2007-11-01T11:25:05Z")

</div>

Is your site online right now? maybe the problem is related to the way  
paths are mapped…  
are you using radiant in a subdirectory?

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 1, 2007, 6:20am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/11 "2007-11-01T06:20:04Z")

</div>

Thanks Andrea. I’d like to say again something I said earlier, but  
using different words 🙂

When I enter the Radiant admin panel and click on the Galleries tab,  
the resulting page (which I think is your list.rhtml) is not  
rendering in Radiant’s application.rhtml layout. No stylesheets or  
javascripts are being loaded.

I have sort of managed to get Radiant 0.6.3 installed. It’s updated  
anyway, but now my Radiant project isn’t working and the upgrade  
instructions don’t work for me.

Thanks for all your help.

Phillip

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 2, 2007, 12:11am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/12 "2007-11-02T00:11:36Z")

</div>

I am working on an image extension, which stores the images in the  
database, then resizes them on retrieval. To make this at all usable,  
I of course need to be able to cache the images. I had hoped to use  
the Radiant system to do this, but so far have been unable to make  
this work. I am basing the controller on the Radiant site\_controller  
and have been able to write the image to the cache folder without  
problem.

The problems start when retrieving the image: first it does not  
recognize that an image has been cached and when I force it, then  
retrieving the image results in a blank page.

Two questions: should I even bother with the Radiant system? Does it  
bring me an advantage or should I just use the standard rails caching.

Second Question: what am I doing wrong? Can this system even cache  
images?

Here is the image\_controller, anything totally stupid and obvious?  
[http://pastie.caboo.se/113246](http://pastie.caboo.se/113246)

Thanks for any help.

Keith B.

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 1, 2007, 2:23pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/13 "2007-11-01T14:23:28Z")

</div>

On Nov 1, 2007, at 5:24 AM, Andrea F. wrote:

> Is your site online right now? maybe the problem is related to the way  
> paths are mapped…  
> are you using radiant in a subdirectory?

Yes, it is online. No, radiant is not in a subdir. It’s a gem. Can  
you elaborate a little about your mapping thought? I’ve been working  
with rails for only about 6 months, and I have not yet ventured into  
anything other than the most basic route mapping.

Thanks,  
Phillip

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 2, 2007, 12:26am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/14 "2007-11-02T00:26:13Z")

</div>

> recognize that an image has been cached and when I force it, then  
> retrieving the image results in a blank page.
> 
> Two questions: should I even bother with the Radiant system? Does it  
> bring me an advantage or should I just use the standard rails caching.
> 
> Second Question: what am I doing wrong? Can this system even cache  
> images?

You’re doing nothing wrong, in fact, you’re reproducing my  
shards\_attachment extension (which you shouldn’t use because I find  
parts of it distasteful and plan on rewriting it with unit tests and  
a decent interface for transformation… eventually)

[http://soxbox.no-ip.org/radiant/svn/extensions/shard\_attachments/](http://soxbox.no-ip.org/radiant/svn/extensions/shard_attachments/)

and probably more specifically:

[http://soxbox.no-ip.org/radiant/svn/extensions/shard\_attachments/lib/part\_attachments/site\_controller\_extension.rb](http://soxbox.no-ip.org/radiant/svn/extensions/shard_attachments/lib/part_attachments/site_controller_extension.rb)

There’s nothing that jumps out at me from your code as being wrong,  
but I’ve been using the same technique that you’re attempting for  
well over a year now, and it works a treat for me.

Dan.

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 2, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/15 "2007-11-02T22:04:42Z")

</div>

Dan,

thanks for the example, I got it working. The url I was checking was  
incorrect, now that the cache method checks the correct url, it works  
just fine.

Keith

---

<div class="post-metadata">

**Author:** ![pkoebbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ec9cab/32.png) [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Post date:** [November 2, 2007, 12:44am UTC](https://www.ruby-forum.com/t/help-with-gallery-extension/118751/16 "2007-11-02T00:44:20Z")

</div>

> > Second Question: what am I doing wrong? Can this system even cache  
> > images?
> 
> You’re doing nothing wrong, in fact, you’re reproducing my

By which I meant, you are doing _something_ wrong, just that there’s  
nothing fundamentally wrong with your plan.

Dan.
