Hi all, Sorry for the cross post, but I know there are lots of Mako experts in the group too, and the project is a pylons project so I guess its fare to ask here too :)
How can I use a conditional section in an inherited template. I thought this would work, but the content gets displayed twice. What I would like to do is define a section in a parent template that will not show by default unless I set it to show in the child. Please the code below which does not work. Thanks in advance for any and all help Jose parent.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <%def name="profile()"> <% return False %> </%def> % if self.profile(): <h2>title</h2> ${self.profile()} % endif </body> </html> ============================================= child.html <%inherit file="parent.html" /> <%def name="profile()"> == this is just some randome stuff to shick in here == <% return True %> </%def> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
