To insert an image here is the url to use
<img src=" /application_name/static/images/map420x200.png" />
or
URL('static', args='images/map420x200.png')
or simply
URL('static', 'images/map420x200.png') since its only one argument.

from the book : http://web2py.com/books/default/chapter/29/4#URL


1.

URL('a', 'c', 'f', args=['x', 'y'], vars=dict(z='t'))

 is mapped into

/a/c/f/x/y?z=t


a stands for application_name

c stands for controller name

f stands for function name

x and y are arguments

z is a variable of type string with value of 't'




On Fri, Apr 20, 2012 at 7:19 AM, Simon Pickles <[email protected]> wrote:

> Hi,
>
> New to web2py and having trouble with simple HTML in a view. In my
> default/index.html:
>
>
> {{=IMG(_src=URL('static','images/map420x200.png'))}}
> <img src="static/images/map420x200.png" style="border: 2px; width:420px;
> height:200px;"/>
>
> The first line works, rendering the map png. However, the second HTML
> equivalent doesnt. The bordered box appears empty then disappears. Is my
> path wrong?
>
> The app is just created using wizard, and default layout.
>
> Thanks
>
> Simon
>

Reply via email to