Hi Evan,
Thx, that compiles. I think I made another mistake, as it doesn't work yet:
test.dtl:
{% with img=restaurant.restaurant_images|first %}
<img src="/restaurant_image/{{ img.filekey }}/200x200" title="{{ img.caption }}" />
{% endwith %}
erl shell:
Data = [{restaurant, [{restaurant_images, [[{id, "img1"},{filekey, "foo"},{caption, "bar"}]]}]}].
test_dtl:render(Data).
output:
{ok,[[<<"\n<img src=\"/restaurant_image/">>,<<"undefined">>,
<<"/200x200\" title=\"">>,<<"undefined">>,<<"\" />\n">>],
<<"\n">>]}
Op woensdag 11 april 2012 22:06:51 UTC+2 schreef Evan Miller het volgende:
IIRC the required syntax is{% with img=restaurant.restaurant_images|first %}
...
{% endwith %}