You do have syntax error at:
<td>c.links[item]}</td>
should be:
<td>${c.links[item]}</td>
I believe this is what you want... assuming that c.links is being declared in
your controller!
#controller
def some_action(self):
c.links = ["link1","link2","link3"]
return render_response('/some_template.mak')
#some_template.mak
<table>
% for item in c.links:
<tr>
<td>${item}</td>
</tr>
% endfor
</table>
voltron wrote:
> Hi,
>
> I tnink this is for the Pylons group and not Mako, if I´m mistaken, I
> apologize
>
> given:
>
> c.links =["link1", "link2", "link3"]
>
> <table>
> % for item in c.links:
> <tr>
> <td>c.links[item]}</td>
> </tr>
> % endfor
> </table>
>
> How do I iterate over the list? My code above does not work.
>
>
> Thanks
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---