On Mar 13, 12:57 pm, Matthew McNaughton <[email protected]>
wrote:
> Greetings team,
Hi Matthew and welcome
> I'm fairly new to HTML and WEB2PY and I am having some problems with
> code below. I am trying to write a view that pulls information from a
> database, called applications, and displays it on the page.
> Specifically, I can't seem to find the syntax for the IMG HTML helper?
> Also if I wanted to resize the image to make sure it wasn't larger than
> a particular size how would I do this? Thank you all. I'm enjoying
> learning web2py
>
> {{extend 'layout.html'}}
> <h1>Current Applications</h1>
> <ul>
> {{for application in applications:}}
> {{=IMG(application.logo)}}
just like you would do in HTML but adding an underscore to the
attribute name:
{{=IMG(_src=application.logo)}}
assuming application.logo contains the URI
if not use the URL function to build it.
You could also specify width and height here but that is probably
better left to CSS.
> {{=LI(A(application.name, _href=URL(r=request, f="show",
> args=application.id))) }}
> {{=application.descn}}
> {{pass}}
> </ul>
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.