[Zope] Re: tal:content="structure... and unicode... How to get it work in Zope 2.10.4 ?

Andreas Elvers andreas at work.de
Wed Jul 25 09:12:37 EDT 2007


Andreas Jung wrote:

>> <span tal:replace="structure python:u'deja vu'"></span>

>>
>>
> 
> Likely because you're using the u'...' notation. However I have no clue why
> do you want to work with unicode strings this way...this looks somewhat
> artificial (independent of the behavior).
> 

You are right. The u'...' notation does no good in a page template. It was
just a test to understand unicode strings in page templates.

Moving the string out into a python script and calling the template
gives me deja vu as expected.

example script:
mystring = u'déjà vu'
return context.template(mystring=mystring)

example template:
mystring: <span tal:replace="structure options/mystring"></span>

Thanks,
- Andreas



More information about the Zope mailing list