Always use the URL() helper to generate URLs:
IMG(_src=URL('static', 'images/example.jpg'), ...)
Anthony
On Thursday, February 28, 2013 9:02:39 PM UTC-5, jjg0 wrote:
>
> Hi everyone, this one might be a really silly question but here goes:
>
> I have a folder of pictures for a site that I threw in the static folder.
> So for example, the path to an example.jpg might look like this:
>
> c:\web2py\applications\myapp\static\images\example.jpg.
>
> These aren't photos I'm expecting users to upload, these are just site
> photos so the download function won't be very useful here.
> When I place the images in a view, I'm just using the IMG helper like so:
>
> {{=IMG(_src='/myapp/static/images/example.jpg', width='100',
> _height='100', _alt='my example image')}}
>
> I am worried that in the future if I ever have to change the name of myapp
> this will cause a lot of trouble having to go through each image in every
> view and changing the name there as well. Especially if the site gets
> rather large. Is there a way to specify the /myapp/static/images/ part of
> the path for my images so I only have to change it once if it ever does
> change? Or maybe I'm just worrying too much?
>
> Thanks!
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.