pylons - Mako: How to access loop variable in tag? -


i cannot figure out how access loop variable blog_post_uri inside tag can dynamically load content defined in template.

% blog_post_uri in blog_post_uris:     <div class="blog-preview">         ## works fine         ${blog_post_uri}          ## not         <%namespace name="blog_post" file="${blog_post_uri}" />         ${blog_post.blog_preview()}         <a href="blog/${blog_post.filename}">read more...</a>     </div> % endfor  

when try compile template, following error:

nameerror: name 'blog_post_uri' not defined

i tried <%! attributes['uri'] = blog_post_uri %> method (with template.render(attributes={})), same error.


Comments