Hi,
some kind of usage problems with page_attachments:
-
has somebody found out how to cycle through page_attachments?
I want to render all the attachments as a list or in a gallery like
format but could not find something like <r:attachment:each />
<r:attachment:first />
<r:attachment:next />
<r:attachment:previous />
<r:attachment:count />
<r:attachment:last />
-
can the upload attachment functionality be made accessible from within a
non-admin page (i.e. from the front-end,
something like Asset-Upload?)
Thanks for your help.
Cheers,
Michael
Michael,
- 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.
- 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
On 7/17/07, Sean C. [email protected] wrote:
Michael,
- 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.
Mmm, I disagree…
What If want to attach a few files and show them inside a table? Just
the name and the size, which will allow me later replace those files
with updated ones without thinking on the name of the file 
- 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.
But I agree on this… file uploads from front-end is way beyond the
scope of page_attachments… also, i see a lot of attempts to convert
those sites to a pr0n web storage 
–
Luis L.
Multimedia systems
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi
Adding some iteration tags is actually not very hard. You can easily
find all page attachments for a given page and cycle through them. I
have done this, but I am not sure where the tags are…
I prefer
some sort of gallery plugin for such things, but sometimes it is nice
to have a few images together. I will see if I can find the tags and
post them.
As for the second part, I would have to agree with Sean.
Keith B.
Tel: +49-7731-7983830
[email protected]
http://keithbingman.com
Hi
On Tue, 2007-07-17 at 23:33 +0300, Keymone wrote:
- 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? 
- 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
Keith B. wrote:
Adding some iteration tags is actually not very hard. You can easily
find all page attachments for a given page and cycle through them. I
have done this, but I am not sure where the tags are…
I prefer
some sort of gallery plugin for such things, but sometimes it is nice
to have a few images together. I will see if I can find the tags and
post them.
I wasn’t challenging the difficulty, just that I personally don’t need
it. As always with open-source software, anyone is welcome to modify
it. I can see some compelling use cases for iteration, but
page_attachments was never meant to be a gallery.
Sean
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:
management…he?
from a
functionality.
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Ryan H.
Art of Mission, Inc.
3720 Gattis School Rd #800 PMB 245
Round Rock, TX 78664
800-722-1492 (phone)
www.artofmission.com
[email protected]