ImageField 'sizes' with AnnotationStorage?

11 messages Options
Embed this post
Permalink
Kees Hink () ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
I used to be able to set sizes: {'gallery': (100, 70), etc.} on an ImageField.
That way, a tag for the field 'image1' would be available in that size by
calling 'context/image1_gallery/tag'. (<img tal:replace="structure
context/image1_performance_listing/tag" />)

When i use AnnotationStorage (instead of AttributeStorage), i get an attribute
error for 'image1'. The image is viewable as object/++atfield++image1, but i
can't figure out how get a tag for the scaled image. It's not available as
object/++atfield++image1_gallery.

How can i do this?

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Raphael Ritz () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
Kees Hink wrote:

> I used to be able to set sizes: {'gallery': (100, 70), etc.} on an ImageField.
> That way, a tag for the field 'image1' would be available in that size by
> calling 'context/image1_gallery/tag'. (<img tal:replace="structure
> context/image1_performance_listing/tag" />)
>
> When i use AnnotationStorage (instead of AttributeStorage), i get an attribute
> error for 'image1'. The image is viewable as object/++atfield++image1, but i
> can't figure out how get a tag for the scaled image. It's not available as
> object/++atfield++image1_gallery.
>
> How can i do this?

http://pypi.python.org/pypi/archetypes.fieldtraverser

Raphael

>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Kees Hink () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
Thanks Raphael, i missed this.

However, object/++atfield++image1-gallery/tag gives a 404 (no attribute error,
funnily). How to traverse to the tag for the scaled image?

Raphael Ritz wrote:

> Kees Hink wrote:
>> I used to be able to set sizes: {'gallery': (100, 70), etc.} on an ImageField.
>> That way, a tag for the field 'image1' would be available in that size by
>> calling 'context/image1_gallery/tag'. (<img tal:replace="structure
>> context/image1_performance_listing/tag" />)
>>
>> When i use AnnotationStorage (instead of AttributeStorage), i get an attribute
>> error for 'image1'. The image is viewable as object/++atfield++image1, but i
>> can't figure out how get a tag for the scaled image. It's not available as
>> object/++atfield++image1_gallery.
>>
>> How can i do this?
>
> http://pypi.python.org/pypi/archetypes.fieldtraverser
>
> Raphael
>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Robert Niederreiter () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
Hi

Am Mittwoch, den 18.03.2009, 13:42 +0100 schrieb Kees Hink:
> Thanks Raphael, i missed this.
>
> However, object/++atfield++image1-gallery/tag gives a 404 (no attribute error,
> funnily). How to traverse to the tag for the scaled image?
Whats the name of your image field in the schema?

--
Robert Niederreiter
IT-Architecture & Engineering
Aflingerstraße 7
A-6176 Völs
+43 699 160 20 192
+43 512 89 00 77

Squarewave Computing         WEB APPLICATIONS,  ZOPE,  PLONE, HOSTING
BlueDynamics Alliance        production: concept, development, design
http://squarewave.at         consulting: analysis, coaching, training
http://bluedynamics.com      management: projects, process, community



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Kees Hink () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
image1

Robert Niederreiter wrote:
> Hi
>
> Am Mittwoch, den 18.03.2009, 13:42 +0100 schrieb Kees Hink:
>> Thanks Raphael, i missed this.
>>
>> However, object/++atfield++image1-gallery/tag gives a 404 (no attribute error,
>> funnily). How to traverse to the tag for the scaled image?
> Whats the name of your image field in the schema?
>

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Robert Niederreiter () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink

Am Mittwoch, den 18.03.2009, 15:09 +0100 schrieb Kees Hink:
> image1
obj/++atfield++image1-thumb. you don't need any tag imho.
the example you pointed would require a traverser for field traverser

cheers

>
> Robert Niederreiter wrote:
> > Hi
> >
> > Am Mittwoch, den 18.03.2009, 13:42 +0100 schrieb Kees Hink:
> >> Thanks Raphael, i missed this.
> >>
> >> However, object/++atfield++image1-gallery/tag gives a 404 (no attribute error,
> >> funnily). How to traverse to the tag for the scaled image?
> > Whats the name of your image field in the schema?
> >
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Archetypes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/archetypes-users
--
Robert Niederreiter
IT-Architecture & Engineering
Aflingerstraße 7
A-6176 Völs
+43 699 160 20 192
+43 512 89 00 77

Squarewave Computing         WEB APPLICATIONS,  ZOPE,  PLONE, HOSTING
BlueDynamics Alliance        production: concept, development, design
http://squarewave.at         consulting: analysis, coaching, training
http://bluedynamics.com      management: projects, process, community



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Kees Hink () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
Thanks for thinking along on this.

However, i think i haven't made my goal clear enough. I want to create an image
tag for the 'gallery' size (or 'thumb' size in your example) in the page
template, like this:
<img tal:replace="structure context/++atfield++image1-gallery/tag" />

This would create a complete tag to put in the html, which is what i'm looking
for. Putting <img tal:replace="attributes="src
context/++atfield++image1-gallery" /> does not work.

Kees

Robert Niederreiter wrote:

> Am Mittwoch, den 18.03.2009, 15:09 +0100 schrieb Kees Hink:
>> image1
> obj/++atfield++image1-thumb. you don't need any tag imho.
> the example you pointed would require a traverser for field traverser
>
> cheers
>
>> Robert Niederreiter wrote:
>>> Hi
>>>
>>> Am Mittwoch, den 18.03.2009, 13:42 +0100 schrieb Kees Hink:
>>>> Thanks Raphael, i missed this.
>>>>
>>>> However, object/++atfield++image1-gallery/tag gives a 404 (no attribute error,
>>>> funnily). How to traverse to the tag for the scaled image?
>>> Whats the name of your image field in the schema?
>>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> _______________________________________________
>> Archetypes-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/archetypes-users

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Kees Hink () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
In reply to this post by Robert Niederreiter
I see now that i have been careless in my previous reply, not having tried well
enough to craft an image tag from TAL.

Creating the tag in this manner works:

              <img tal:define="url context/absolute_url;
                               src string: ${url}/++atfield++image1-gallery;"
                   tal:attributes="src src" />

So i consider my problem solved.

However, i'm still curious to learn if it would be possible to have the scaled
field create a tag for itself, which would also correctly set the title
attribute. With AttributeStorage you could do it like this:
<img tal:replace="structure context/image1_gallery/tag" />
Which is also shorter.

Thanks all, for helping me with this so far.

Kees

Robert Niederreiter wrote:

> Am Mittwoch, den 18.03.2009, 15:09 +0100 schrieb Kees Hink:
>> image1
> obj/++atfield++image1-thumb. you don't need any tag imho.
> the example you pointed would require a traverser for field traverser
>
> cheers
>
>> Robert Niederreiter wrote:
>>> Hi
>>>
>>> Am Mittwoch, den 18.03.2009, 13:42 +0100 schrieb Kees Hink:
>>>> Thanks Raphael, i missed this.
>>>>
>>>> However, object/++atfield++image1-gallery/tag gives a 404 (no attribute error,
>>>> funnily). How to traverse to the tag for the scaled image?
>>> Whats the name of your image field in the schema?
>>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> _______________________________________________
>> Archetypes-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/archetypes-users

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Jens W. klein-2 () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
In reply to this post by Kees Hink
Am Wed, 18 Mar 2009 11:11:34 +0100 schrieb Kees Hink:

> I used to be able to set sizes: {'gallery': (100, 70), etc.} on an
> ImageField. That way, a tag for the field 'image1' would be available in
> that size by calling 'context/image1_gallery/tag'. (<img
> tal:replace="structure context/image1_performance_listing/tag" />)
>
> When i use AnnotationStorage (instead of AttributeStorage), i get an
> attribute error for 'image1'. The image is viewable as
> object/++atfield++image1, but i can't figure out how get a tag for the
> scaled image. It's not available as object/++atfield++image1_gallery.
>
> How can i do this?

As usal. You call the tag method of the ImageField. This should work fine
and hasnt changed.

object.Schema()['yourimagefieldname'].tag(object,
scale='yourpreferedscale')

hth Jens
--
Jens W. Klein - Klein & Partner KEG - BlueDynamics Alliance


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Kees Hink () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
Thanks, but this is not what i mean. I would like to call this method from TAL,
and calling  <img tal:attributes="src python:
context.Schema()['image1'].tag(context, 'gallery')" /> isn't allowed there.

I'm looking for something analogous to
<img tal:replace="structure context/image1_performance_listing/tag" />

Kees

Jens W. Klein wrote:

> Am Wed, 18 Mar 2009 11:11:34 +0100 schrieb Kees Hink:
>
>> I used to be able to set sizes: {'gallery': (100, 70), etc.} on an
>> ImageField. That way, a tag for the field 'image1' would be available in
>> that size by calling 'context/image1_gallery/tag'. (<img
>> tal:replace="structure context/image1_performance_listing/tag" />)
>>
>> When i use AnnotationStorage (instead of AttributeStorage), i get an
>> attribute error for 'image1'. The image is viewable as
>> object/++atfield++image1, but i can't figure out how get a tag for the
>> scaled image. It's not available as object/++atfield++image1_gallery.
>>
>> How can i do this?
>
> As usal. You call the tag method of the ImageField. This should work fine
> and hasnt changed.
>
> object.Schema()['yourimagefieldname'].tag(object,
> scale='yourpreferedscale')
>
> hth Jens

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Jens W. klein-2 () Re: ImageField 'sizes' with AnnotationStorage?
Reply Threaded More More options
Print post
Permalink
Am Thu, 19 Mar 2009 13:04:30 +0100 schrieb Kees Hink:

> Thanks, but this is not what i mean. I would like to call this method
> from TAL, and calling  <img tal:attributes="src python:
> context.Schema()['image1'].tag(context, 'gallery')" /> isn't allowed
> there.

Well, use a view-class for the logic and it works. I usally dont put such
framework related calls in templates.

> I'm looking for something analogous to <img tal:replace="structure
> context/image1_performance_listing/tag" />

Archetypes should provide a default view one can use or inherit from, but
thats a different story.

Jens

> Kees
>
> Jens W. Klein wrote:
>> Am Wed, 18 Mar 2009 11:11:34 +0100 schrieb Kees Hink:
>>
>>> I used to be able to set sizes: {'gallery': (100, 70), etc.} on an
>>> ImageField. That way, a tag for the field 'image1' would be available
>>> in that size by calling 'context/image1_gallery/tag'. (<img
>>> tal:replace="structure context/image1_performance_listing/tag" />)
>>>
>>> When i use AnnotationStorage (instead of AttributeStorage), i get an
>>> attribute error for 'image1'. The image is viewable as
>>> object/++atfield++image1, but i can't figure out how get a tag for the
>>> scaled image. It's not available as object/++atfield++image1_gallery.
>>>
>>> How can i do this?
>>
>> As usal. You call the tag method of the ImageField. This should work
>> fine and hasnt changed.
>>
>> object.Schema()['yourimagefieldname'].tag(object,
>> scale='yourpreferedscale')
>>
>> hth Jens
--
Jens W. Klein - Klein & Partner KEG - BlueDynamics Alliance


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users