If I'm using a whole page macro, here seems to refer to the object containing the macro rather than the object using the macro. If I'm trying to construct a <title/>, I'd like to do something like this: $site : $page E.g., foo.com : about But if I do this: <title tal:content="python:'%s : %s' % (container.title_or_id(), here.title_or_id())"></title> both of these resolve to---oops, now I suspect I've found a bug. Both of them resolve to the title or id of the Root folder. I wonder if this is because I'm using a VirtualHostMonster? /Root (title: foo.com) master_html index_html In the above scenario, I get <title>foo.com : foo.com</title>. // mark -
Mark McEahern wrote:
both of these resolve to---oops, now I suspect I've found a bug. Both of them resolve to the title or id of the Root folder. I wonder if this is because I'm using a VirtualHostMonster?
Your description is a little too fragmented to tell. You mention using a macro, and don't indicate the context of your test. If the <title> tag you describe is being called from index_html, and index_html is in the root, then 'container' will always be the root object. 'here' will also be the root object, unless you are acquiring index_html into another folder. Did you expect 'here' to be the template itself? That's 'template'. Cheers, Evan @ 4-am
Your description is a little too fragmented to tell. You mention using a macro, and don't indicate the context of your test. If the <title> tag you describe is being called from index_html, and index_html is in the root, then 'container' will always be the root object. 'here' will also be the root object, unless you are acquiring index_html into another folder. Did you expect 'here' to be the template itself? That's 'template'.
Holy cow! Thanks for reading my mind. template is precisely what I was looking for. Thanks! // mark -
participants (2)
-
Evan Simpson -
Mark McEahern