Re: [Zope-dev] ZPT Plain Text
x tal:repeat=object here/collection tal:omit-tag= I am y tal:replace=object/id / /x Everybody keeps forgetting it, but this should work: tal:loop repeat=object here/collection I am y tal:replace=object/id / /tal:loop Because tags in the 'tal' namespace are stripped. I could have used dummy instead of loop though. Florent -- Florent Guillaume, Nuxeo SARL (Paris, France) +33 1 40 33 79 10 http://nuxeo.com mailto:[EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Florent Guillaume wrote: x tal:repeat=object here/collection tal:omit-tag= I am y tal:replace=object/id / /x Everybody keeps forgetting it, but this should work: tal:loop repeat=object here/collection I am y tal:replace=object/id / /tal:loop Because tags in the 'tal' namespace are stripped. I could have used dummy instead of loop though. I did forget that, and that makes it even better :-) Thanks Florent... Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Martijn Faassen wrote: How would you do repeating texts or conditional texts like this? I mean, perhaps it's obvious; I haven't played enough with ZPT yet. repeat: x tal:repeat=object here/collection tal:omit-tag= I am y tal:replace=object/id / /x condition: yes tal:condition=here/has_objects_in_basket tal:omit-tag= You have c tal:replace=here/basket_count/ objects in your basket /yes no tal:condition=not here/has_objects_in_basket tal:omit-tag= Your basket is empty /no I also think this looks rather unnatural when doing email templates or SQL templates. I used to think that, I'm quickly changing positions. Perhaps the only option I'd like is a check box somewhere on the template object saying something like always include tal:omit-tag by default. Then I reckon it could do for everything :-) cheers, Chris -- more and more a ZPT-ONLY! fan each day... ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Hi out there :) How would you do repeating texts or conditional texts like this? I mean, perhaps it's obvious; I haven't played enough with ZPT yet. Just for your info: there is one product that tries to address this problem: TERRY http://www.zope.org/Members/lalo/TextTemplates It is a modified version of TAL that doesn't use XML but a custom syntax: %(tal:content=here/fgcolor black)% I don't now, if this makes things easier, but it would ensure at least the use of TALES and has similar usage. I also think this looks rather unnatural when doing email templates or SQL templates. I used to think that, I'm quickly changing positions. Perhaps the only option I'd like is a check box somewhere on the template object saying something like always include tal:omit-tag by default. Then I reckon it could do for everything :-) cheers, Chris -- more and more a ZPT-ONLY! fan each day... YES :))) One Template-Language for all: ZPT .. and one Expression Syntax as well: TALES .. cheers Ulrich Eck --- net-labs Systemhaus GmbH Ebersberger Str. 46 85570 Markt Schwaben fon: +49-8121-4747-11 fax: +49-8121-4747-77 email: [EMAIL PROTECTED] http://www.net-labs.de ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
I was about to mention TERRY, but Ulrich beat me to it. One nice thing about TERRY is that it allows you to change the markup simbols. For instance it is entirely possible to use: ?tal:content=here/fgcolor black? (which, by the way, is a semi-standard way to do extentions to html and looks like php escapes) instead of %(tal:content=here/fgcolor black)% However I think there still isn't an easy, thru the web, way to change the markup signals. On Wed, 2001-12-05 at 09:41, Ulrich Eck wrote: Hi out there :) How would you do repeating texts or conditional texts like this? I mean, perhaps it's obvious; I haven't played enough with ZPT yet. Just for your info: there is one product that tries to address this problem: TERRY http://www.zope.org/Members/lalo/TextTemplates It is a modified version of TAL that doesn't use XML but a custom syntax: %(tal:content=here/fgcolor black)% I don't now, if this makes things easier, but it would ensure at least the use of TALES and has similar usage. I also think this looks rather unnatural when doing email templates or SQL templates. I used to think that, I'm quickly changing positions. Perhaps the only option I'd like is a check box somewhere on the template object saying something like always include tal:omit-tag by default. Then I reckon it could do for everything :-) cheers, Chris -- more and more a ZPT-ONLY! fan each day... YES :))) One Template-Language for all: ZPT .. and one Expression Syntax as well: TALES .. -- Ideas don't stay in some minds very long because they don't like solitary confinement. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Chris Withers wrote: Chris -- more and more a ZPT-ONLY! fan each day... How would you email someone some output from the Python interactive interpreter? In other words, how do you get a naked or or in a plain-text ZPT? I guess you'd need to have a special page template interpreter that knows that it isn't putting out SGML-style stuff. -- Steve Alexander ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Steve Alexander wrote: I guess you'd need to have a special page template interpreter that knows that it isn't putting out SGML-style stuff. Indeed, you can, of course, use lt; amd amp; in the meantime if the HTML parser in ZPT does barf (which maybe it shouldn't?) Sounds like the content type in a page template could be very useful: if content_type='text/plain': self._parser = PlainTextTagParser() self._alls_ommit_tags=1 cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Ulrich Eck wrote: Hi out there :) How would you do repeating texts or conditional texts like this? I mean, perhaps it's obvious; I haven't played enough with ZPT yet. Just for your info: there is one product that tries to address this problem: TERRY http://www.zope.org/Members/lalo/TextTemplates It is a modified version of TAL that doesn't use XML but a custom syntax: %(tal:content=here/fgcolor black)% I don't now, if this makes things easier, but it would ensure at least the use of TALES and has similar usage. Yes, TALES seems to be the way to go, unless we opt for a really micro-language dedicated to do only one thing and nothing more. I'm unconvinced I want to explain ZPT with omit-tag etc for someone just writing SQL, for instance, though. Looks worse and is harder to explain even than DTML, which is bad news. Regards, Martijn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
Chris Withers wrote: Phillip J. Eby wrote: I personally would like to see ZPT support plain text at some point, and it already has some of the things necessary to do it. But that's a separate issue from Zope 3X or Zope 3 itself. It already can: dummy tal:omit-tag= tal:content=mymethod Some dummy text /dummy Or even: dummy tal:replace=mymethod Some dummy text /dummy It's more long winded that DTML in this case, but there's no need for another markup language... How would you do repeating texts or conditional texts like this? I mean, perhaps it's obvious; I haven't played enough with ZPT yet. I also think this looks rather unnatural when doing email templates or SQL templates. A completely stripped down magic-less variety of something DTMLish with support for tales expressions might be worth exploring for these purposes. Another possibility is to design teeny dedicated systems that are magic rich but extremely limited (and then strongly resist any extending it). Something is needed for ZSQL at least in my opinion. In XPath Methods I simply used the way XPath deals with variables ($foo) to parameterize them. Perhaps there are some semi-standard conventions for SQL that we could use? Regards, Martijn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPT Plain Text
At 05:58 PM 12/4/01 +, Chris Withers wrote: Phillip J. Eby wrote: I personally would like to see ZPT support plain text at some point, and it already has some of the things necessary to do it. But that's a separate issue from Zope 3X or Zope 3 itself. It already can: [example snipped] Last I looked, there were still certain constructs that could not have the tag opted-out-of. But that was a month or two ago and TAL moves fast... :) I don't remember seeing tal:omit-tag before, so maybe that was the last piece of the puzzle. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )