Getting an image depending on a variable

Tom Lazar lists at tomster.org
Mon Nov 12 18:56:01 UTC 2007


On Nov 12, 2007, at 5:03 PM, Johannes Schwenk wrote:

> Hi all,
>
> I have the following problem:
>
> I want to get the width and height of an image in my pagetemplate. The
> thing is, it should be depending on a stored attribute. I would get
> the stored attribute like this in a TALES expression:
>
> image_size context/ImageSize;
>
> where image size is in ["full", "large", "preview", "mini"].
>
> I get the image like so (it's in a loop)
>
> image python:images[0];
>
> Now the thing is the following does not work!
>
> image_width image/image_${image_size}/width;
>
> How would I accomplish this?

use a view. you are trying to accomplish too much in the template.

cheers,

tom

>
>
> Thanks!
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
>





More information about the Product-Developers mailing list