# Page\_attachments thumbnails

**URL:** <https://www.ruby-forum.com/t/page-attachments-thumbnails/106089>\
**Category:** Radiant CMS\
**Created:** [June 6, 2007, 9:53am UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089 "2007-06-06T09:53:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 9:53am UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/1 "2007-06-06T09:53:20Z")

</div>

Hi,

I have page\_attachments installed and running on Radiant edge. I also  
have MiniMagick installed. gem list shows:

mini\_magick (1.2.0)  
Manipulate images with minimal use of memory.

The \<r:attachment:image /\> tag works very well!

But in the Available Tags list, I can’t see anything related to  
generating a thumbnail. Is there something like  
\<r:attachment:thumbnail /\> ?

Thank you.

J.

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 1:13pm UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/2 "2007-06-06T13:13:52Z")

</div>

In order to generate a thumbnail with MiniMagick, you need to set the  
processor to :mini\_magick. You can do this in the PageAttachments  
model, just where it says “has\_attachment”.

I have written my own tags that allow you to access the thumbnails,  
but these are currently not in page\_attachments. It is a very easy  
tag to add, you just have to understand how attachment\_fu works.  
There is a good tutorial on attachment\_fu at [http://clarkware.com/cgi/](http://clarkware.com/cgi/)  
blosxom/2007/02/24#FileUploadFu, which shows all the various parameters.

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 2:29pm UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/3 "2007-06-06T14:29:06Z")

</div>

There’s no specific support for thumbnails, other than being generated  
to support the UI. They are 50x50 by default. Would a “thumbnail” tag  
be helpful?

Sean

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 2:40pm UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/4 "2007-06-06T14:40:07Z")

</div>

I solved it by writing an image tag with a “size” attribute. This  
just passes a key to the public\_filename in attachment\_fu. Then I can  
make and access any size I want using something like  
\<r:attachment:image size=“thumbnail” /\> with calls the image path  
with “public\_filename(:thumbnail)”. This gives me a great deal of  
flexibility to autogenerate specific sizes and easily call them.

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/5 "2007-06-06T14:42:08Z")

</div>

Awesome, Keith. I’ll put that in the extension right away.

Sean

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 2:51pm UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/6 "2007-06-06T14:51:10Z")

</div>

I forgot, I did something similar on the link tag, so that you can  
make links to specific image sizes as well. I don’t use this one  
much, but it is good for embedding light box images in blog posts and  
such. Like this: /[http://bitchkittyracing.com/articles/keiths-visit-](http://bitchkittyracing.com/articles/keiths-visit-)  
days-0-1/

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![jonathan2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@jonathan2000](https://www.ruby-forum.com/u/jonathan2000)\
**Post date:** [June 6, 2007, 2:46pm UTC](https://www.ruby-forum.com/t/page-attachments-thumbnails/106089/7 "2007-06-06T14:46:09Z")

</div>

If you would like, I can send you the code I have.

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)
