To iterate over attachments like this:

<r:attachments:each>
   <r:attachment:url />
</r:attachments:each>

Add these tags to page_attachment_tags.rb:

   desc %{
     Gives access to a page's attachments.

     *Usage:*
     <pre><code><r:attachments>...</r:attachments></code></pre>
   }
   tag "attachments" do |tag|
     tag.locals.attachments = tag.locals.page.attachments
     tag.expand
   end

   desc %{
     Cycles through each of the attachments. Inside this tag all  
attachments
     are mapped to the current attachment.

     *Usage:*
     <pre><code><r:attachments:each>
      ...
     </r:attachments:each>
     </code></pre>
   }
   tag "attachments:each" do |tag|
     result = []
     tag.locals.attachments.each do |attachment|
       tag.locals.attachment = attachment
       result << tag.expand
     end
     result
   end




On Jul 18, 2007, at 3:15 AM, Michael Pyschny wrote:

> Hi
>
> On Tue, 2007-07-17 at 23:33 +0300, Keymone wrote:
>
>> 1) imho it's not very good assumption... iteration would be VERY  
>> useful
>> feature
>> for example to easily create javascript-based gallery. when i  
>> create page
>> Gallery i won't attach anything except images i want to show...
>>
>
> Who's developing it? ;-)
>
>
>> 2) i agree with Sean..
>
> I use Adreas Subscriber extension and upload will only be allowed for
> logged in members ...and the quota can easily be controlled by the
> page_attachment extension. Quota itself will be defined in the
> subscriber config or on per subscriber base. Sounds like a basic asset
> management..he?
>
> Cheers
> Michael
>
>>
>> On 7/17/07, Sean Cribbs <[EMAIL PROTECTED]> wrote:
>>>
>>> Michael,
>>>
>>> 1) page_attachments assumes you want a particular file accessible  
>>> from a
>>> particular page or its children.  It also assumes you know the  
>>> name of
>>> the file and makes no assumptions about the format of the file,  
>>> be it
>>> text, image or some other binary format.  There is no way to iterate
>>> through the attachments of any given page.
>>> 2) This again falls out of the scope of page_attachments.  I  
>>> wouldn't
>>> want random visitors uploading files into my page, so I didn't  
>>> add that
>>> functionality.
>>>
>>> Overall, it sounds like you want some full-fledged gallery software.
>>> The gallery extension might fit your needs.  There's also always  
>>> room
>>> for another extension that implements the functionality you desire.
>>>
>>> Sean
>>>
>>
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>

------------------------------------------------
Ryan Heneise
Art of Mission, Inc.
3720 Gattis School Rd #800 PMB 245
Round Rock, TX 78664

800-722-1492 (phone)

www.artofmission.com
[EMAIL PROTECTED]



_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to