What does Firefox show -- missing image icons? Do the links work?
Side note -- is a.advert.thumbnail a recursive
select<http://web2py.com/books/default/chapter/29/6#Recursive-selects>?
Note that they execute a separate query for each item, so if you're looping
through a long list of adverts, you're doing a lot of db queries. Instead,
you might want to do a single initial query with a join so the thumbnail
filenames are included in the original set of records.
Anthony
On Sunday, April 29, 2012 6:38:56 AM UTC-4, Simon Pickles wrote:
>
> Hi
>
> I am using this code to create a crude grid of images with links:
>
> {{for a in adverts:}}
> {{=A(IMG(_src=URL('static', 'images/ads/' + a.advert.thumbnail),
> _alt="My Logo"),
> _href=URL('default','index'))}}
>
> This renders as:
> <a href="/test2/default/index"><img alt="My Logo"
> src="/test2/static/images/ads/jamie.jpg" /></a>
>
> Shows up fine in IE9 but doesnt in Firefox 10. If I go to the address of
> the image directly by putting it in the address bar (
> http://127.0.0.1:8000/test2/static/images/ads/jamie.jpg), it works.. the
> image appears. It just doesnt appear in my firefox page when generated with
> the python code above.
>
> Can anyone shed any light?
>