# How can I return a list of attachments, skipping the first?

**URL:** <https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247>\
**Category:** Radiant CMS\
**Created:** [August 29, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247 "2008-08-29T20:03:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/1 "2008-08-29T20:03:41Z")

</div>

The title says it all. Is there a way to use \<r:attachment:each\> while  
skipping the first result? I have a logo and a number of PDFs attached  
to a page and I just want to list the PDFs. Is that possible with the  
page\_attachments plugin as it is? If so how?

Thanks,  
~Nate

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/2 "2008-08-29T20:39:39Z")

</div>

removed\_email\_address@domain.invalid wrote:

> The title says it all. Is there a way to use \<r:attachment:each\> while  
> skipping the first result? I have a logo and a number of PDFs attached  
> to a page and I just want to list the PDFs. Is that possible with the  
> page\_attachments plugin as it is? If so how?
> 
> Thanks,  
> ~Nate

An offset option may be built in. But if it isn’t, it’s not hard to add.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/3 "2008-08-29T20:40:41Z")

</div>

By the way, are you using paperclipped or page attachments?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/4 "2008-08-29T20:47:38Z")

</div>

On Fri, 2008-08-29 at 20:40 +0200, Arik J. wrote:

> By the way, are you using paperclipped or page attachments?

Page Attachments. I plan on trying out paperclipped on a future project,  
but on this one I stuck with what I knew (mostly).

~Nate

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:51pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/5 "2008-08-29T20:51:25Z")

</div>

removed\_email\_address@domain.invalid wrote:

> On Fri, 2008-08-29 at 20:40 +0200, Arik J. wrote:
> 
> > By the way, are you using paperclipped or page attachments?
> 
> Page Attachments. I plan on trying out paperclipped on a future project,  
> but on this one I stuck with what I knew (mostly).
> 
> ~Nate

Paperclipped is waaaay easier and a little more flexible. You can access  
all attachments from anywhere using the radiant tags. Where as in Page  
Attachments, you normally have to re-upload or remember what page a  
certain asset is attached to. The interface is much cleaner as well.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:59pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/6 "2008-08-29T20:59:53Z")

</div>

Arik J. wrote:

> Paperclipped is waaaay easier and a little more flexible. You can access  
> all attachments from anywhere using the radiant tags. Where as in Page  
> Attachments, you normally have to re-upload or remember what page a  
> certain asset is attached to. The interface is much cleaner as well.

Can Paperclipped work without Image Magick installed? PageAttachments  
does, and simply skips all the thumbnail creation stuff.

- Dave

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/7 "2008-08-29T20:58:46Z")

</div>

On Fri, 2008-08-29 at 20:51 +0200, Arik J. wrote:

> Paperclipped is waaaay easier and a little more flexible. You can access  
> all attachments from anywhere using the radiant tags. Where as in Page  
> Attachments, you normally have to re-upload or remember what page a  
> certain asset is attached to. The interface is much cleaner as well.

Now you tell me. Thanks. So just as a for-instance, how would you return  
the documents attached to a page while skipping the first one?

~Nate

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/8 "2008-08-29T21:03:27Z")

</div>

On Fri, 2008-08-29 at 20:51 +0200, Arik J. wrote:

> Paperclipped is waaaay easier and a little more flexible.

Can it exist along with page\_attachments in the same project? That way I  
can move things over gradually instead of redoing the entire attachment  
scheme at the 10th hour (not quite 11th hour yet).

This coming up with a better-idea-than-what-you-just-implemented has got  
to stop. How can I pause in internets so that I can catch up?

~Nate

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 9:11pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/9 "2008-08-29T21:11:42Z")

</div>

removed\_email\_address@domain.invalid wrote:

> On Fri, 2008-08-29 at 20:51 +0200, Arik J. wrote:
> 
> > Paperclipped is waaaay easier and a little more flexible.
> 
> Can it exist along with page\_attachments in the same project? That way I  
> can move things over gradually instead of redoing the entire attachment  
> scheme at the 10th hour (not quite 11th hour yet).
> 
> This coming up with a better-idea-than-what-you-just-implemented has got  
> to stop. How can I pause in internets so that I can catch up?
> 
> ~Nate

It’s not really our fault that you didn’t properly test all your  
options. I’m just revealing what I’ve discovered in my own experiences.  
Sure, the timing blows. But hey, it’s just code.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 9:23pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/10 "2008-08-29T21:23:56Z")

</div>

> It’s not really our fault that you didn’t properly test all your  
> options. I’m just revealing what I’ve discovered in my own  
> experiences.  
> Sure, the timing blows. But hey, it’s just code.

hmmm I’m pretty sure the original comment from Nate was intended to be  
humorous in nature…

On the serious side though, I’m trying to think up a solution that  
will help with sorting through the extensions out there. For a new  
person coming to Radiant, there doesn’t seem to be a good way to  
figure out what extensions to pick, how hard they are to install, what  
incompatibilities there are etc. without trying everything out and  
digging around in the mailing list archives. Once upon a time it was  
easy to know all the available extensions and keep on top of things,  
it’s getting to the point where it’s no longer easy and soon will be  
nigh impossible.

-C

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/11 "2008-08-29T21:18:05Z")

</div>

It looks to me like Paperclipped has it’s own version of Image Magick,  
so you don’t have to install it. (please, someone correct me if I’m  
wrong) It’s been a while, but I think I didn’t bother installing Image  
Magick on my machine because of the headache, and here is Paperclipped  
creating thumbnails for me somehow…

Now, disabling thumbnail creation for the sake of saving resources… I  
have my doubts about how easy that would be to do…

-C  
PS: I just tried Paperclipped today. Wholly awesome Batman! Why wasn’t  
it listed on the wiki? I was amazed and slightly ticked that it was  
such a secret… (I made sure to add it to the wiki)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/12 "2008-08-29T21:25:59Z")

</div>

Now I see why there are emoticons. lol.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/how-can-i-return-a-list-of-attachments-skipping-the-first/147247/13 "2008-08-29T21:44:39Z")

</div>

Christopher D. wrote:

> On the serious side though, I’m trying to think up a solution that  
> will help with sorting through the extensions out there. For a new  
> person coming to Radiant, there doesn’t seem to be a good way to  
> figure out what extensions to pick, how hard they are to install, what  
> incompatibilities there are etc. without trying everything out and  
> digging around in the mailing list archives. Once upon a time it was  
> easy to know all the available extensions and keep on top of things,  
> it’s getting to the point where it’s no longer easy and soon will be  
> nigh impossible.
> 
> -C

I talked a little bit about this some time ago. ExpressionEngine has 3rd  
party extensions/plugins which are usually free and then there are the  
“approved” extensions which are usually extensions built by the EE  
development team and or a few select non-core developers. It’s basically  
just a “Recommended” list of extensions.

Would Radiant benefit from something like this?
