On Nov 5, 2010, at 01:17 , Simon Rönnqvist wrote:
>
> On Nov 3, 2010, at 15:08 , Jim Gay wrote:
>
>> 2010/11/3 Simon Rönnqvist <[email protected]>:
>>> Hi!
>>> I'm using an old Radiant 0.7.1 installation with the page_attachments
>>> extension in use.
>>> In the Radiant admin interface thumbnails seem to be working, I get small
>>> icons for attached images there. But on the actual web pages I don't get
>>> resized images showing up, I might be doing something wrong... but the
>>> page_attachments extension doesn't seem to be all that well documented, so I
>>> turn to you. :)
>>> I added PAGE_ATTACHMENT_SIZES = {:thumb => '120x120>', :normal =>
>>> '640x480>'} at the end of my environment.rb and restarted the app, I used
>>> this kind of Radius code:
>>> <r:children:each order="desc">
>>> <div class="entry">
>>> <h2><r:title /></h2>
>>> <r:attachment:each
>>> extensions="png|jpg"><r:attachment:link><r:attachment:image:thumb
>>> /></r:attachment:link><br /></r:attachment:each>
>>> <r:content />
>>> </div>
>>> </r:children:each>
>>> What I get is a full sized image. Any ideas of where things might have gone
>>> wrong?
>>> When I tested with just a simple <r:attachment:image:thumb name="image.png"
>>> /> again I got ‘name’ attribute required in the page.
>>> cheers, Simon
>>
>> I don't see where a "thumb" radius tag is defined in the source. Why
>> did you expect that tag to work? We'll need to correct the docs if
>> that's where you got it.
>> Looking at the 0.6.9 tagged code (and it's still this way in the
>> latest version) I see the description of the image tag:
>>
>> https://github.com/radiant/radiant-page-attachments-extension/blob/0.6.9/app/models/page_attachment_tags.rb#L117
>>
>> Have you tried:
>> <r:attachment:image name="file.jpg" size="thumb"/>
>
> Hi!
>
> Sorry missed your post. As you might have seen from something I posted
> shortly after your post (even though I missed it) I didn't get that from any
> documentation at all, in fact I was unable to find anything about it... but
> later on I remembered reading somewhere that one should use the
> size-attribute, as you pointed out. (But it sucks a little bit that the
> size-attributes also shows up in the actual output... and a validator would
> choke on that.)
>
> Anyways... now I got it working, but I only get it working for size="icon"
> but not size="thumb"... this also applies to newly added images. For
> size="thumb" it links the image correctly, but the thumb-image isn't simply
> generated. However my PAGE_ATTACHMENT_SIZES = {:thumb => '120x120>', :normal
> => '640x480>'} at the end of environment.rb seems to be recognized as new
> normal images (without a size attribute) are now limited to the specified
> size.
>
> cheers, Simon
My assumption that it did recognize 'normal' size was wrong, the images in
question just happened to be small enough. :) So I moved PAGE_ATTACHMENT_SIZES
= {:thumb => '120x120>', :normal => '640x480>'} to the beginning of
environment.rb instead and voila, it works! :)
cheers, Simon