From tino@wildenhain.de Wed Nov 6 16:50:53 2002 From: tino@wildenhain.de (Tino Wildenhain) Date: Wed, 06 Nov 2002 17:50:53 +0100 Subject: [ZPT] Re: [Zope] ZPT issues In-Reply-To: <005201c28590$dd647b90$1e71a8c0@uz.kuleuven.ac.be> References: <005201c28590$dd647b90$1e71a8c0@uz.kuleuven.ac.be> Message-ID: <35078630.1036605053@liza> Hi Tom, this exacly was a problem for my design here to: ZPT dont implement real inheritance :(( I had success with the following workaround: 1) Master Template - this holds the global layout and things which are common to all pages. Its broken up in small macros for every constant part. 2) several Temlates for bigger parts of the site, e.g. standard table, standard question-box etc. Each in a separate template as it seems convenient, die rest is filled in from master template so it looks like a complete page - this is just for quick overview 3) Function centric templates - these are for a small group of pages or even a single page, like a "type of page". They form a big macro, which covers the whole HTML (actually I use tag around and strip this in edit-view/ftp/webdav so co-worker cannot circumvent the macro) Every constant part is assembled there from macros of the master template (1) (for example navigation) and macros of the desired standard element template(s) (2). Every piece of text which should be localized is surrounded by define-slots. All other parts remain constant (this also saves the app-logic from beeing accidently overwritten) 4) The pages which use their function specific template (3) and only allow the slots to be filled, which are mostly text. Usually there is one for any language version (I use language negotiation to provide the relevant content-language to a user, app-functions get their language selection from surrounded page) >From what I can tell this works pretty well and avoids to repeat things too often. (Only the global table structure is repeated because of the unability to do inheritance) HTH Tino Wildenhain PS: this thread should be moved to ZPT list I think. (Sorry for the cross posting) --On Mittwoch, 6. November 2002 13:34 +0100 Tom Deprez wrote: > Hi, > > I'm not sure how to implement something with ZPT and need your advice: > > I'll do my best to explain the problem, but I'm not sure if I will > succeed, since it is not easy to show. > > I've a site which has several folders, they all follow the same strategy. > Basicly what you have is a page with the top half some general > information. The bottom half is split in two 'panes': the left contains a > list of items, the right contains more information of the selected item. > People can delete/edit/look a selected item. Depending on what people > want to do, the right bottom 'pane' has to be different. Every action is > in a different folder, so the layout looks like: > > Root > ... > Lists > Flowers > Delete > Edit > Insert > Boats > Delete > Edit > Insert > ... > > Now, I'm implementing this in PT, but I'm a little stuck here, since it > seems ZPT can't stack. eg I've a master PT which defines the general > layout (menus) and contains slots, situated in the root. The slots are > toppane (to fill in the toppane) and bottompane (to fill in the > bottompane). To be correct, I should create a new master page for the > 'Flowers' & 'Boats' folders, because they have a different layout, namely > 'top pane', 'bottom left pane', 'bottom right pane'. > But when I do this, aren't I then overruling the way for what PT were > designed? If I now want to change the layout of my site, I have to change > 2 pages (and who know how much more if we go further into detail). > Changing 2 isn't that bad, however, most of the parts are in fact the > same! The menu handling etc is the same... > > I was wondering if it is possible to have PT which can inherit from > another PT, but can extend it with new slots/macros. Which is at the > moment not possible, I think. > > Thanks in advance, > Tom. > > > _______________________________________________ > Zope maillist - Zope@zope.org > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) From mlong@datalong.com Thu Nov 7 05:19:21 2002 From: mlong@datalong.com (Michael Long) Date: Thu, 07 Nov 2002 00:19:21 -0500 Subject: [ZPT] (no subject) Message-ID: I am building a table where each row is a form. The last row rendered builds the url string incorrectly. All the other rows build the url correctly. The first url below works correctly the second does not. http://myurl?RoleId=3&RoleName=Users&Id=3&frmAction=UpdateRole&id=&x=18&y=9 http://myurl?RoleId=3&RoleName=Users&Id=3&frmAction=UpdateRole&RoleId=&RoleName=&id=&x=18&y=9 Here is the script to build the table:
Role Id Role Name Action
What could be causing this? Thanks, Mike From mlong@datalong.com Thu Nov 7 05:28:16 2002 From: mlong@datalong.com (Michael Long) Date: Thu, 07 Nov 2002 00:28:16 -0500 Subject: [ZPT] (no subject) Message-ID: I just answers my own question. I had another row in the table that had some tags in it that were not wrapped in form tags. It appears that these were appended to the url string even though they were outside of the form tag. > I am building a table where each row is a form. The last row rendered > builds the url string incorrectly. All the other rows build the url > correctly. The first url below works correctly the second does not. > > http://myurl?RoleId=3&RoleName=Users&Id=3&frmAction=UpdateRole&id=&x=18&y=9 > http://myurl?RoleId=3&RoleName=Users&Id=3&frmAction=UpdateRole&RoleId=&RoleName=&id=&x=18&y=9 > > Here is the script to build the table: > > > > > > > > tal:attributes="class python:repeat['role'].odd() and 'odd' or > 'even'" > tal:repeat="role request/AllRoles"> > > > > > > > >
Role IdRole NameAction
type="text" name="RoleId" size="3"> type="text" name="RoleName" size="12"> > tal:attributes="value role/role_id|nothing"> > value="UpdateRole">
> > What could be causing this? > > Thanks, > Mike > > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt > > From tom.deprez@uz.kuleuven.ac.be Thu Nov 7 09:53:47 2002 From: tom.deprez@uz.kuleuven.ac.be (Tom Deprez) Date: Thu, 7 Nov 2002 10:53:47 +0100 Subject: [ZPT] Re: [Zope] ZPT issues References: <005201c28590$dd647b90$1e71a8c0@uz.kuleuven.ac.be> <35078630.1036605053@liza> Message-ID: <012a01c28643$91213a80$1e71a8c0@uz.kuleuven.ac.be> Hi Tino, I'm glad I'm not the only one which has this kind of problem, I was already thinking that I some malfunction in my brain. Thanks for sharing your ideas. And yes, you're right about the ZPT list. I forgot about the existence of that one. Regards, Tom > Hi Tom, > > this exacly was a problem for my design here to: > ZPT dont implement real inheritance :(( > > I had success with the following workaround: > > 1) Master Template - this holds the global layout and things > which are common to all pages. Its broken up in small macros > for every constant part. > 2) several Temlates for bigger parts of the site, e.g. standard table, > standard question-box etc. Each in a separate template as it seems > convenient, die rest is filled in from master template so it looks > like a complete page - this is just for quick overview > 3) Function centric templates - these are for a small group of pages > or even a single page, like a "type of page". They form a big > macro, which covers the whole HTML (actually I use tag around > and strip this in edit-view/ftp/webdav so co-worker cannot > circumvent the macro) > Every constant part is assembled there from macros of the master > template (1) (for example navigation) and macros of the desired > standard element template(s) (2). > Every piece of text which should be localized is surrounded by > define-slots. All other parts remain constant (this also saves > the app-logic from beeing accidently overwritten) > 4) The pages which use their function specific template (3) and only > allow the slots to be filled, which are mostly text. Usually there > is one for any language version (I use language negotiation to > provide the relevant content-language to a user, app-functions get > their language selection from surrounded page) > >> From what I can tell this works pretty well and avoids to repeat >> things > too often. (Only the global table structure is repeated because of the > unability to do inheritance) > > HTH > Tino Wildenhain > > PS: this thread should be moved to ZPT list I think. (Sorry for the > cross posting) > > > > > --On Mittwoch, 6. November 2002 13:34 +0100 Tom Deprez > wrote: > >> Hi, >> >> I'm not sure how to implement something with ZPT and need your >> advice: >> >> I'll do my best to explain the problem, but I'm not sure if I will >> succeed, since it is not easy to show. >> >> I've a site which has several folders, they all follow the same >> strategy. Basicly what you have is a page with the top half some >> general information. The bottom half is split in two 'panes': the >> left contains a list of items, the right contains more information >> of the selected item. People can delete/edit/look a selected item. >> Depending on what people want to do, the right bottom 'pane' has to >> be different. Every action is in a different folder, so the layout >> looks like: >> >> Root >> ... >> Lists >> Flowers >> Delete >> Edit >> Insert >> Boats >> Delete >> Edit >> Insert >> ... >> >> Now, I'm implementing this in PT, but I'm a little stuck here, since >> it seems ZPT can't stack. eg I've a master PT which defines the >> general layout (menus) and contains slots, situated in the root. >> The slots are toppane (to fill in the toppane) and bottompane (to >> fill in the bottompane). To be correct, I should create a new master >> page for the 'Flowers' & 'Boats' folders, because they have a >> different layout, namely 'top pane', 'bottom left pane', 'bottom >> right pane'. But when I do this, aren't I then overruling the way >> for what PT were designed? If I now want to change the layout of my >> site, I have to change 2 pages (and who know how much more if we go >> further into detail). Changing 2 isn't that bad, however, most of >> the parts are in fact the same! The menu handling etc is the same... >> >> I was wondering if it is possible to have PT which can inherit from >> another PT, but can extend it with new slots/macros. Which is at the >> moment not possible, I think. >> >> Thanks in advance, >> Tom. >> >> >> _______________________________________________ >> Zope maillist - Zope@zope.org >> http://lists.zope.org/mailman/listinfo/zope >> ** No cross posts or HTML encoding! ** >> (Related lists - >> http://lists.zope.org/mailman/listinfo/zope-announce >> http://lists.zope.org/mailman/listinfo/zope-dev ) From blalor+dated+1037658927.2c62f3@ithacabands.org Wed Nov 13 22:36:13 2002 From: blalor+dated+1037658927.2c62f3@ithacabands.org (Brian Lalor) Date: 13 Nov 2002 15:36:13 -0700 Subject: [ZPT] PHP port of TAL? Message-ID: Howdy, all. I'm interested in a port of TAL to PHP. Has anyone attempted such a thing? Would anyone be interested in taking part in such an endeavor? Thanks, B -- Brian Lalor | http://introducingthelalors.org/ blalor@ithacabands.org (email) | blalor@jabber.ithacabands.org (jabber) N33°27.369' W111°56.304' (Earth) From jim@zope.com Wed Nov 13 22:54:35 2002 From: jim@zope.com (Jim Fulton) Date: Wed, 13 Nov 2002 17:54:35 -0500 Subject: [ZPT] PHP port of TAL? References: Message-ID: <3DD2D82B.1070905@zope.com> Brian Lalor wrote: > Howdy, all. I'm interested in a port of TAL to PHP. Way cool. I think that would be a great idea. > Has anyone attempted > such a thing? Not that I'm aware of. There's a Perl port. > Would anyone be interested in taking part in such an endeavor? I would if I wasn't so busy with Zope 3. I'd certainly be willing to lurk on a dedicated mailing list and answer questions about the spec, philosophy, etc. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (888) 344-4332 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org From =?ISO-8859-15?B?TWFudWVsIEFyaXN0YXLhbg==?=" References: Message-ID: <67864692.20021113215508@softhome.net> Hi.. > I'm interested in a port of TAL to PHP. Has anyone attempted > such a thing? Would anyone be interested in taking part in such an endeavor? Well, I'm very interested. I began to explore the source code of TAL and made a couple tests with PHP's XML parsing functions. If you want to start such a project, i'm willing to participate. Cheers, -- Manuel Aristarán http://jazzido.freezope.org Bahía Blanca, Argentina From blalor+dated+1037712677.c47391@ithacabands.org Thu Nov 14 13:41:52 2002 From: blalor+dated+1037712677.c47391@ithacabands.org (Brian Lalor) Date: 14 Nov 2002 06:41:52 -0700 Subject: [ZPT] Re: PHP port of TAL? References: <67864692.20021113215508@softhome.net> Message-ID: --=-=-= Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit "Manuel Aristarán" writes: > Well, I'm very interested. I began to explore the source code of TAL and > made a couple tests with PHP's XML parsing functions. I started to explore that path last night. I'd be interested in seeing what you've got, Manuel. > If you want to start such a project, i'm willing to participate. The more I look at the Python code, the less trivial I think this is going to be. :-) Could someone kind if give an overview of how the internals work? There's not much in the way of documentation in the Python code. From what I gather, an XML parser is used to parse the template source and creates "opcodes" out of the various TAL and METAL commands. That code is then parsed by an interpreter which actually handles the TALES expressions. Why weren't the Python SGML or XML parsers used for the compilation phase? I see that the overall structure of the included (HT|X)ML parser is quite similar to that of the bundles Python versions and I think I'll be able to replicate that shell pretty easily in PHP (what Manuel has probably already accomplished). I've never written a compiler or generator like this; some days I think I should have finished that CompSci degree... :-) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit -- Brian Lalor | http://introducingthelalors.org/ blalor@ithacabands.org (email) | blalor@jabber.ithacabands.org (jabber) N33°27.369' W111°56.304' (Earth) --=-=-=-- From fred@zope.com Thu Nov 14 19:06:46 2002 From: fred@zope.com (Fred L. Drake, Jr.) Date: Thu, 14 Nov 2002 14:06:46 -0500 Subject: [ZPT] Re: PHP port of TAL? In-Reply-To: References: <67864692.20021113215508@softhome.net> Message-ID: <15827.62534.882404.180080@grendel.zope.com> Brian Lalor writes: > The more I look at the Python code, the less trivial I think this > is going to be. :-) It certainly won't be trivial! > Could someone kind if give an overview of how the internals work? > There's not much in the way of documentation in the Python code. > From what I gather, an XML parser is used to parse the template > source and creates "opcodes" out of the various TAL and METAL > commands. That code is then parsed by an interpreter which > actually handles the TALES expressions. For some definition of parsed, yes. The use of "bytecodes" (is "tuplecodes" a word? ;) is done to avoid parsing the *ML each time we render a page. It's really a performance optimization, but necessary for real servers in practice. > Why weren't the Python SGML or XML parsers used for the compilation > phase? I see that the overall structure of the included (HT|X)ML > parser is quite similar to that of the bundles Python versions and > I think I'll be able to replicate that shell pretty easily in PHP > (what Manuel has probably already accomplished). I'm not sure what you mean. The Python XML parser is used for XML, but a custom parser was written for HTML since we wanted to be a little closer to the lexical level than htmllib supported. (This parser, in TAL/HTMLParser.py, has been added to the Python standard library in Python 2.2, but originated in the TAL code.) We'll be glad to answer specific questions as they come up, but we're pretty crushed for time these days. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From blalor+dated+1037730855.ddba77@ithacabands.org Thu Nov 14 18:40:10 2002 From: blalor+dated+1037730855.ddba77@ithacabands.org (Brian Lalor) Date: 14 Nov 2002 11:40:10 -0700 Subject: [ZPT] Re: PHP port of TAL? References: <67864692.20021113215508@softhome.net> Message-ID: "Manuel Aristarán" writes: > Well, I'm very interested. I began to explore the source code of TAL and > made a couple tests with PHP's XML parsing functions. > > If you want to start such a project, i'm willing to participate. Hm, my response this morning must have gotten lost in the ether. That's what I get for computing before the morning cup of coffee kicks in. :-P Anyway, I'd like to explore this some more. My boss has interest in using TAL, but the implementation can't take months. I figure worst-case I can just convert the Python code (ugh). I've got a couple of questions to start things off, not necessarily related to the port. Why is there a "DummyEngine" module in the TAL distribution? It seems to me that the engine's what provides the TALES functionality. Shouldn't it be fairly standard? How do the HTMLParser, HTMLTALParser, TALGenerator, TALInterpreter and DummyEngine modules all tie together? Er, I guess that's it for now. Just wanted to let everyone know that I am in fact interested... Thanks, B -- Brian Lalor | http://introducingthelalors.org/ blalor@ithacabands.org (email) | blalor@jabber.ithacabands.org (jabber) N33°27.369' W111°56.304' (Earth) From evan@4-am.com Thu Nov 14 21:17:40 2002 From: evan@4-am.com (Evan Simpson) Date: Thu, 14 Nov 2002 15:17:40 -0600 Subject: [ZPT] Re: PHP port of TAL? References: <67864692.20021113215508@softhome.net> Message-ID: <3DD412F4.8050405@4-am.com> Brian Lalor wrote: > I've got a couple of questions to start things off, not necessarily related to > the port. Why is there a "DummyEngine" module in the TAL distribution? It > seems to me that the engine's what provides the TALES functionality. > Shouldn't it be fairly standard? The "real" TALES implementation lives in the PageTemplates Product, but since the three modules (the third being ZTUtils) that drive ZPT are theoretically independent, DummyEngine provides a stub TALES implementation for the unit tests. > How do the HTMLParser, HTMLTALParser, TALGenerator, TALInterpreter and > DummyEngine modules all tie together? The steps from raw template source to execution are as follows: 1. Make a TALES expression compiler instance (sort of optional). 2. Make a TALGenerator instance, passing it the expression compiler and the source code/file for the template. If no compiler is passed in, it will use DummyEngine. 3. Make a TALParser or HTMLTALParser, passing it the TALGenerator instance. These are descended from XMLParser and HTMLParser, respectively. HTMLParser is a lot more forgiving when it comes to things like unclosed tags. 4. Call the parseString() or parseFile() method of your parser. This will read the template source, parse it, and send "events" to the TALGenerator for each opening tag, closing tag, and other significant structure. TALGenerator looks for opening tags with TAL, METAL, or I18N attributes or namespace declarations. It constructs instruction tuples and pushes them onto a program stack, using the expression compiler on TALES expressions. 5. Call the getCode() method of the parser to get data structures representing the TAL program and METAL macro definitions of the template. 6. Get an execution context from the expression compiler and pass it, along with the TAL program, to a TALInterpreter instance. Call the instance to execute the template in that context. There are a number of shortcomings to this implementation, not least of which is the complexity of instruction tuple generation. Nobody has had time to improve on it, sadly. I'll be happy to answer questions about the implementation or design; Please ask if you have any! Cheers, Evan @ 4-am From pboizot@pb2i.com Fri Nov 15 17:56:29 2002 From: pboizot@pb2i.com (Pierre Boizot) Date: Fri, 15 Nov 2002 18:56:29 +0100 Subject: [ZPT] ZPT and Javascript Message-ID: <1037382989.3dd5354d1188d@webmail.first-telecom.fr> Hi , Thiscode that is well formed and that is a valid xhtml code can not be use in Template Page. The compilation error has return. Workaround : Put javascript in dtml document best regards. Pierre Enter the title of your XHTML document here

Enter the body text of your XHTML document here

-- Pierre Boizot PB2i.com 283, CHEMIN DU CARRAIRE LE BOUTEILLER 84660 MAUBEC ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From tino@wildenhain.de Sat Nov 16 14:16:10 2002 From: tino@wildenhain.de (Tino Wildenhain) Date: Sat, 16 Nov 2002 15:16:10 +0100 Subject: [ZPT] ZPT and Javascript In-Reply-To: <1037382989.3dd5354d1188d@webmail.first-telecom.fr> References: <1037382989.3dd5354d1188d@webmail.first-telecom.fr> Message-ID: <9433845.1037459770@liza> Hi Pierre, --On Freitag, 15. November 2002 18:56 +0100 Pierre Boizot wrote: > Hi , > > Thiscode that is well formed and that is a valid xhtml code can not be > use in Template Page. > The compilation error has return. > Workaround : > Put javascript in dtml document > best regards. Or in a file object. And may be its better to avoid generating HTML this way if possible. Regards Tino > Pierre > > Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> > Enter the title of your XHTML document here >

Enter the body text of > your XHTML document here

> -- > Pierre Boizot > PB2i.com > 283, CHEMIN DU CARRAIRE > LE BOUTEILLER > 84660 MAUBEC > > > > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From willem@pastelhorn.com Sun Nov 17 03:25:19 2002 From: willem@pastelhorn.com (Willem Broekema) Date: Sun, 17 Nov 2002 02:25:19 -0100 Subject: [ZPT] ZPT and Javascript In-Reply-To: <1037382989.3dd5354d1188d@webmail.first-telecom.fr> References: <1037382989.3dd5354d1188d@webmail.first-telecom.fr> Message-ID: <3DD70C1F.7040807@pastelhorn.com> Pierre Boizot wrote: > Enter the title of your XHTML document hereThiscode that is well > formed and that is a valid xhtml code can not be use in > Template Page. > The compilation error has return. I tried your code: the ZPT Product included in Zope 2.6.0b2 does accept it without problems (but there are indeed older versions which don't). - Willem From Dmitry Matveev Mon Nov 18 11:54:18 2002 From: Dmitry Matveev (Dmitry Matveev) Date: Mon, 18 Nov 2002 16:54:18 +0500 Subject: [ZPT] the best way for repeation Message-ID: <29347998405.20021118165418@uralfirm.ru> Hello! Depending on the condition I use one of the methods for repeation (container.sql.discussions.select or container.sql.posts.select). What way of implimentation is better?: 1. The code
....
2. The code is much longer here
....
....
3. The code is similar to the first, but to use request until global.
....
-- Best regards, www.uralfirm.ru Dmitry Matveev mailto:matveev@uralfirm.ru From jamie@audible.transient.net Mon Nov 18 12:32:16 2002 From: jamie@audible.transient.net (Jamie Heilman) Date: Mon, 18 Nov 2002 04:32:16 -0800 Subject: [ZPT] the best way for repeation In-Reply-To: <29347998405.20021118165418@uralfirm.ru> References: <29347998405.20021118165418@uralfirm.ru> Message-ID: <20021118123216.GU5720@stink-foot.audible.transient.net> I'd say use method 2, but you can shorten your code by doing: ...
...
You don't need all that extra defining & nesting. -- Jamie Heilman http://audible.transient.net/~jamie/ "You came all this way, without saying squat, and now you're trying to tell me a '56 Chevy can beat a '47 Buick in a dead quarter mile? I liked you better when you weren't saying squat kid." -Buddy From mark@mceahern.com Tue Nov 19 20:19:45 2002 From: mark@mceahern.com (Mark McEahern) Date: Tue, 19 Nov 2002 14:19:45 -0600 Subject: [ZPT] whitespace Message-ID: Suppose I want to generate this: 012 That is, I don't want any whitespace between generated elements. This won't work: What will? Thanks, // mark - From zpt@zope.org Tue Nov 19 20:29:28 2002 From: zpt@zope.org (Clemens Robbenhaar) Date: Tue, 19 Nov 2002 21:29:28 +0100 Subject: [ZPT] whitespace In-Reply-To: References: Message-ID: <15834.40744.683142.875550@galsan.espresto.com> > Suppose I want to generate this: > > 012 > > That is, I don't want any whitespace between generated elements. > > This won't work: > > > > What will? Add a dummy tag around the one using for repetition, e.g. works for me, using Zope2.6.0 Clemens From mark@mceahern.com Tue Nov 19 20:43:15 2002 From: mark@mceahern.com (Mark McEahern) Date: Tue, 19 Nov 2002 14:43:15 -0600 Subject: [ZPT] whitespace In-Reply-To: <15834.40744.683142.875550@galsan.espresto.com> Message-ID: [Clemens Robbenhaar [mailto:robbenhaar@espresto.com]] > Add a dummy tag around the one using for repetition, e.g. > > tal:content="n"> > > works for me, using Zope2.6.0 That's closer! Thanks! However, this: now generates this (comments omitted since they lie): 0123456789 I looked in TAL/TALInterpreter--is the wrapping a result of TALInterpreter.__init__(..., wrap=60, ...)? How could I make that 9999 or something like that without modifying TALInterpreter (or whatever calls it)? That is, is there a way to control that from the PageTemplate? Something like: ... ? Thanks, // mark - From jamie@audible.transient.net Wed Nov 20 02:20:26 2002 From: jamie@audible.transient.net (Jamie Heilman) Date: Tue, 19 Nov 2002 18:20:26 -0800 Subject: [ZPT] whitespace In-Reply-To: References: <15834.40744.683142.875550@galsan.espresto.com> Message-ID: <20021120022025.GX5720@stink-foot.audible.transient.net> > now generates this (comments omitted since they lie): > > 012 href="3">345 href="6">678 href="9">9 Out of curriosity, why does that matter? Even in preformated blocks the above is functionaly equivilent to the same markup all on one line. I guess I could understand why it would be a problem if you were returning something other than text/html, but I'm betting TAL isn't gonna be a good candidate for much of anything that has strict whitespace requirements. -- Jamie Heilman http://audible.transient.net/~jamie/ "Paranoia is a disease unto itself, and may I add, the person standing next to you may not be who they appear to be, so take precaution." -Sathington Willoughby From chrisw@nipltd.com Wed Nov 20 10:30:19 2002 From: chrisw@nipltd.com (Chris Withers) Date: Wed, 20 Nov 2002 10:30:19 +0000 Subject: [ZPT] whitespace bug References: <15834.40744.683142.875550@galsan.espresto.com> Message-ID: <3DDB643B.1020408@nipltd.com> Clemens Robbenhaar wrote: > > Suppose I want to generate this: > > > > 012 > > > > That is, I don't want any whitespace between generated elements. > > > > This won't work: > > > > It should, IMNSHO. Can you file a collector issue at http://collector.zope.org? > Add a dummy tag around the one using for repetition, e.g. > > That's pretty weird. I wonder why wrapping the tag in a useless block causes whitespace not to be emitted? *grumble* bug *grumble* Chris From mj@zope.com Wed Nov 20 16:05:36 2002 From: mj@zope.com (Martijn Pieters) Date: Wed, 20 Nov 2002 11:05:36 -0500 Subject: [ZPT] whitespace bug In-Reply-To: <3DDB643B.1020408@nipltd.com> References: <15834.40744.683142.875550@galsan.espresto.com> <3DDB643B.1020408@nipltd.com> Message-ID: <20021120160536.GA31776@zope.com> On Wed, Nov 20, 2002 at 10:30:19AM +0000, Chris Withers wrote: > Clemens Robbenhaar wrote: > > > Suppose I want to generate this: > > > > > > 012 > > > > > > That is, I don't want any whitespace between generated elements. > > > > > > This won't work: > > > > > > > > It should, IMNSHO. Can you file a collector issue at > http://collector.zope.org? Why is this a bug? > > Add a dummy tag around the one using for repetition, e.g. > > > > >tal:content="n"> > > That's pretty weird. I wonder why wrapping the tag in a useless block > causes whitespace not to be emitted? > > *grumble* bug *grumble* This is intended behaviour; whitespace surrounding a repeated tag is repeated as well. Otherwise there would be no way to preserve whitespace in between repeated items! Putting the repeated tag directly inside another eliminated the whitespace (including the newline) and was thus not repeated. The whitespace included is limited to the whitespace on the line, IIRC. This is reasonable and confirms to the XML specs. It may be (although I doubt it) that the xml:space attribute is supported, but how ZPT should react if xml:space is set to preserve is a whole different kettle of fish. -- Martijn Pieters | Software Engineer mailto:mj@zope.com | Zope Corporation http://www.zope.com/ | Creators of Zope http://www.zope.org/ --------------------------------------------- From max@provico.fi Wed Nov 20 18:05:53 2002 From: max@provico.fi (Max Romantschuk) Date: Wed, 20 Nov 2002 20:05:53 +0200 Subject: [ZPT] Nesting templates Message-ID: <000e01c290bf$78625a20$1324e60a@Tor> Hello eveyone, I'm new to the list and Zope, but I do have a lot of experience with we development (HTML, several programming languages and SQL). I found Zope some time ago and thought I'd make myself a simple site to learn something. I have, however, run into problems. The problems are mainly that I don't know what tools to use to achieve my goals. I'll try to explain what I'm trying to do... My basic idea is to build a site wich would have the following basic properties 1. Dynamic navigation 2. Master template through which all content is fetched I've been trying to do this by doing a sturcture like this: site_root/index_html Site master template site_root/content Folder with all content, as page templates, containing just the content, no reference to the master template. This folder is indexed by the navigation. Any special case functionality can then be put in the root. Then I've been trying to create a script to fetch the correct content and display it. I realize some feel that templates are not content or that I should use CMF, but I want to build something from the ground up to learn. I've been trying to get the master template to include the nested content template by using a tal:content="structure ..." type of syntax, but it seems that this only works when I statically try to give the path to the content. I've been looking all over the web for a proper spec on how this "structure"-keyword is suppose to work, but haven't really found anything. So really my question comes down to: how do I nest a template? Should I even be doing this? CMF I don't wish to use at the moment though. Too complex and too rigid for my taste. I've looked at Kubes, but they looked too much like a kludge. Thanks in advance, Max Romantschuk From chrisw@nipltd.com Thu Nov 21 10:57:13 2002 From: chrisw@nipltd.com (Chris Withers) Date: Thu, 21 Nov 2002 10:57:13 +0000 Subject: [ZPT] whitespace bug References: <15834.40744.683142.875550@galsan.espresto.com> <3DDB643B.1020408@nipltd.com> <20021120160536.GA31776@zope.com> Message-ID: <3DDCBC09.4080706@nipltd.com> Martijn Pieters wrote: >>>> >>> >>It should, IMNSHO. Can you file a collector issue at >>http://collector.zope.org? > > Why is this a bug? There's no space between the and the , so why should any be included in the output? > This is intended behaviour; whitespace surrounding a repeated tag is > repeated as well. Otherwise there would be no way to preserve whitespace in > between repeated items! Why would you want to? > Putting the repeated tag directly inside another eliminated the whitespace > (including the newline) and was thus not repeated. Is that documented anywhere? > The whitespace included is limited to the whitespace on the line, IIRC. This > is reasonable and confirms to the XML specs. Which one? > It may be (although I doubt it) > that the xml:space attribute is supported, but how ZPT should react if > xml:space is set to preserve is a whole different kettle of fish. Indeed. cheers, Chris From mark@mceahern.com Thu Nov 21 14:59:44 2002 From: mark@mceahern.com (Mark McEahern) Date: Thu, 21 Nov 2002 08:59:44 -0600 Subject: [ZPT] whitespace bug In-Reply-To: <3DDCBC09.4080706@nipltd.com> Message-ID: [Martijn Pieters] > This is intended behaviour; whitespace surrounding a repeated tag is > repeated as well. Otherwise there would be no way to preserve > whitespace in between repeated items! [Chris Withers] > Why would you want to? I'm mostly happy knowing that I can use the useless block trick--that solved the particular problem we were having. I don't have a firm understanding of how and why TAL handles whitespace or what control I do have or should have over that from a PageTemplate. I would assume if you wanted to normalize your HTML--nested tags indented just so, etc.--you probably wouldn't use what PageTemplate renders without some tweaking? That's not the problem we had. The problem we had was we didn't want whitespace between a bunch of repeated spans. Thanks for all the replies! Just for reference, this TAL: The title

No space before:

Four spaces before:

Enclosed in a useless block: Generates this output:

No space before: 0 1 2 3 4 5 6 7 8 9

Four spaces before: 0 1 2 3 4 5 6 7 8 9

Enclosed in a useless block: 01234 56789

Cheers, // mark - From mj@zope.com Thu Nov 21 15:07:35 2002 From: mj@zope.com (Martijn Pieters) Date: Thu, 21 Nov 2002 10:07:35 -0500 Subject: [ZPT] whitespace bug In-Reply-To: <3DDCBC09.4080706@nipltd.com> References: <15834.40744.683142.875550@galsan.espresto.com> <3DDB643B.1020408@nipltd.com> <20021120160536.GA31776@zope.com> <3DDCBC09.4080706@nipltd.com> Message-ID: <20021121150735.GK15643@zope.com> On Thu, Nov 21, 2002 at 10:57:13AM +0000, Chris Withers wrote: > >Why is this a bug? > > There's no space between the and the , so why should any be > included in the output? No additional whitespace is included between the opening and closing span tags other than that present in the inserted content. The whitespace I was talking about was that *surrounding* the span tags; the whitespace before the tag and after the tag. > >This is intended behaviour; whitespace surrounding a repeated tag is > >repeated as well. Otherwise there would be no way to preserve whitespace in > >between repeated items! > > Why would you want to? Because whitespace between tags is significant in browsers. Sometimes you don't want the spaces, sometimes you do. Especially when you place the tag on its own line, the original (unrendered) template will show whitespace around that item. > >Putting the repeated tag directly inside another eliminated the whitespace > >(including the newline) and was thus not repeated. > > Is that documented anywhere? I don't know. > >The whitespace included is limited to the whitespace on the line, IIRC. > >This > >is reasonable and confirms to the XML specs. > > Which one? XML 1.0 second edition. -- Martijn Pieters | Software Engineer mailto:mj@zope.com | Zope Corporation http://www.zope.com/ | Creators of Zope http://www.zope.org/ --------------------------------------------- From skip@pobox.com Thu Nov 21 16:52:21 2002 From: skip@pobox.com (Skip Montanaro) Date: Thu, 21 Nov 2002 10:52:21 -0600 Subject: [ZPT] Macro expand box getting checked against my wishes... Message-ID: <15837.3909.478407.552800@montanaro.dyndns.org> I've begun to find page templates with macros expanded. When I look I see the "Expand macros when editing" button checked, though I never checked it. My editing client is generally XEmacs via efs on MacOSX, though I will pop into MSIE to do quick stuff or stuff the FTP interface doesn't support. The server is Zope 2.5.1 w/ PageTemplates 1.4.1 on FreeBSD 4.7. I do a fair amount of copy/paste/edit to create new page templates from existing ones. Is this a known problem? Thx, -- Skip Montanaro - skip@pobox.com http://www.mojam.com/ http://www.musi-cal.com/ From dieter@handshake.de Thu Nov 21 19:05:26 2002 From: dieter@handshake.de (Dieter Maurer) Date: Thu, 21 Nov 2002 20:05:26 +0100 Subject: [ZPT] Macro expand box getting checked against my wishes... In-Reply-To: <15837.3909.478407.552800@montanaro.dyndns.org> References: <15837.3909.478407.552800@montanaro.dyndns.org> Message-ID: <15837.11894.97331.1508@gargle.gargle.HOWL> Skip Montanaro writes: > I've begun to find page templates with macros expanded. When I look I see > the "Expand macros when editing" button checked, though I never checked it. > My editing client is generally XEmacs via efs on MacOSX, though I will pop > into MSIE to do quick stuff or stuff the FTP interface doesn't support. The > server is Zope 2.5.1 w/ PageTemplates 1.4.1 on FreeBSD 4.7. I do a fair > amount of copy/paste/edit to create new page templates from existing ones. > > Is this a known problem? Macro expansion was for a long time the default. Maybe, this is still the case for your Zope version. Dieter From zpt@zope.org Thu Nov 21 20:01:45 2002 From: zpt@zope.org (Clemens Robbenhaar) Date: Thu, 21 Nov 2002 21:01:45 +0100 Subject: [ZPT] Nesting templates In-Reply-To: <000e01c290bf$78625a20$1324e60a@Tor> References: <000e01c290bf$78625a20$1324e60a@Tor> Message-ID: <15837.15273.902030.443053@galsan.espresto.com> Hi Max, [...] > My basic idea is to build a site wich would have the following basic > properties > > 1. Dynamic navigation > 2. Master template through which all content is fetched > > I've been trying to do this by doing a sturcture like this: > > site_root/index_html > Site master template > > site_root/content > Folder with all content, as page templates, containing just the content, no > reference to the master template. This folder is indexed by the navigation. > Any special case functionality can then be put in the root. > > Then I've been trying to create a script to fetch the correct content and > display it. I realize some feel that templates are not content or that I > should use CMF, but I want to build something from the ground up to learn. > > I've been trying to get the master template to include the nested content > template by using a tal:content="structure ..." type of syntax, but it seems > that this only works when I statically try to give the path to the content. > I've been looking all over the web for a proper spec on how this > "structure"-keyword is suppose to work, but haven't really found anything. > About the 'structure' keyword: maybe look at http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx (though it is a little hard to find the place where it is explained that it renders the value without escaping '<', '>', '&' ...) Thus it dies not have a lot to to with Your problem, except that You most proabaly want to use it ;-) > So really my question comes down to: how do I nest a template? Should I even > be doing this? You can do this, if this home grown design/content separation is just good enough for You. However You do not give an example how the content is selected ... I assume the id of the "content" page template to be rendered is passed as request-parameter 'content_id'; e.g. if this is 'foo', You want to include /site_root/content/foo in Yout index_html. The dynamic lookup should go via the 'getattr' helper function, e.g. If the lookup is more complex (e.g. You might want some error handling,) its better done by a script called from the 'index_html'. Well, it seems You are already doing this, if I understand correctly ... > > CMF I don't wish to use at the moment though. Too complex and too rigid for > my taste. I've looked at Kubes, but they looked too much like a kludge. I guess the developers of these products will appreciate Your subtle and informed comments very much ;-> Cheers, Clemens From jtk@yahoo.com Thu Nov 21 20:30:18 2002 From: jtk@yahoo.com (Jeff Kowalczyk) Date: Thu, 21 Nov 2002 15:30:18 -0500 Subject: [ZPT] multiple expressions in tal:condition? Message-ID: I need to test multiple conditions in a tal:condition statement, such as this row controlling rendering of a formulator form. Within: neither nor nor work is there a way to do this? I was able to next the extra conditional in a contained span, but then you still get the tr when you don't want it. I can use tal:define for two local variables, but I wanted to check if there was a direct syntax for {and|or|not} with non-python expressions in tal:condition first. Thanks. From zpt@zope.org Thu Nov 21 21:08:19 2002 From: zpt@zope.org (Clemens Robbenhaar) Date: Thu, 21 Nov 2002 22:08:19 +0100 Subject: [ZPT] multiple expressions in tal:condition? In-Reply-To: References: Message-ID: <15837.19267.422876.131728@galsan.espresto.com> > I need to test multiple conditions in a tal:condition statement, such as this row > controlling rendering of a formulator form. > > Within: > > neither > > nor > ... but this should work, except if 'required' or 'hidden' is something more complicated than a value; in the latter case the condition is always true. Maybe You just want to display these values for debugging, e.g. and look at what You get. If e.g. this is actually a method, You may want to try something like "python:repeatfield.required() and ..." instead. From max@provico.fi Fri Nov 22 05:58:03 2002 From: max@provico.fi (Max Romantschuk) Date: Fri, 22 Nov 2002 07:58:03 +0200 Subject: [ZPT] Nesting templates In-Reply-To: <15837.15273.902030.443053@galsan.espresto.com> References: <000e01c290bf$78625a20$1324e60a@Tor> <15837.15273.902030.443053@galsan.espresto.com> Message-ID: <1037944683.3dddc76bccc00@webmail.nma.fi> Quoting Clemens Robbenhaar : > About the 'structure' keyword: maybe look at > http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx > (though it is a little hard to find the place where it is explained that > it renders the value without escaping '<', '>', '&' ...) OK, found it now... Had looked there aswell, but missed it somehow :) > > So really my question comes down to: how do I nest a template? Should I > > even be doing this? > > You can do this, if this home grown design/content separation is just > good enough for You. However You do not give an example how the content > is selected ... I assume the id of the "content" page template to be > rendered is passed as request-parameter 'content_id'; e.g. if this is > 'foo', You want to include /site_root/content/foo in Yout index_html. I haven't really decided on all the pieces yet, I've been looking at lot's of different ways to do stuff and I'm trying to make out the best one... I'm sure some kind of content object approach is the most scalable solution, but at the moment I'm looking for more of a quick and dirty solution to get me started... Then I'll have something to improve on ;) > The dynamic lookup should go via the 'getattr' helper function, e.g. > > tal:replace="structure content_page" /> > > If the lookup is more complex (e.g. You might want some error handling,) > its better done by a script called from the 'index_html'. Well, it seems > You are already doing this, if I understand correctly ... I'm doing it with a script yes, but so far I've had the problem that my script only returns the path of the object I want, not it's content... But I'll figure that out. > > CMF I don't wish to use at the moment though. Too complex and too rigid > for > > my taste. I've looked at Kubes, but they looked too much like a kludge. > > I guess the developers of these products will appreciate Your subtle > and informed comments very much ;-> I realize this was a but of a flame, but then again I'm willing to back up my opinions and don't mind being proven wrong :) My personal goal is to come up with a solution which is a flexible as possible without having a huge framework that is needed to get to square one. I'm sure I'm not going to get anywhere with my first attempt, but doing everything myself ensures I learn more. Thanks for the help, Max From chrisw@nipltd.com Fri Nov 22 09:27:41 2002 From: chrisw@nipltd.com (Chris Withers) Date: Fri, 22 Nov 2002 09:27:41 +0000 Subject: [ZPT] whitespace bug References: <15834.40744.683142.875550@galsan.espresto.com> <3DDB643B.1020408@nipltd.com> <20021120160536.GA31776@zope.com> <3DDCBC09.4080706@nipltd.com> <20021121150735.GK15643@zope.com> Message-ID: <3DDDF88D.8070905@nipltd.com> Martijn Pieters wrote: > On Thu, Nov 21, 2002 at 10:57:13AM +0000, Chris Withers wrote: > >>There's no space between the and the , so why should any be >>included in the output? > > No additional whitespace is included between the opening and closing span > tags other than that present in the inserted content. Ah, yes, sorry, my mistake. > The whitespace I was talking about was that *surrounding* the span tags; the > whitespace before the tag and after the tag. I guess so :-S > Because whitespace between tags is significant in browsers. Sometimes you > don't want the spaces, sometimes you do. Especially when you place the tag > on its own line, the original (unrendered) template will show whitespace > around that item. Yeah, I can see this now. It does feel kinda odd though... >>>Putting the repeated tag directly inside another eliminated the whitespace >>>(including the newline) and was thus not repeated. >> >>Is that documented anywhere? > > I don't know. It probably should be. If someone can point me to the right place, I'll give it a go... cheers, Chris From chrisw@nipltd.com Fri Nov 22 09:29:28 2002 From: chrisw@nipltd.com (Chris Withers) Date: Fri, 22 Nov 2002 09:29:28 +0000 Subject: [ZPT] Macro expand box getting checked against my wishes... References: <15837.3909.478407.552800@montanaro.dyndns.org> Message-ID: <3DDDF8F8.6060405@nipltd.com> Skip Montanaro wrote: > server is Zope 2.5.1 w/ PageTemplates 1.4.1 on FreeBSD 4.7. Why do you have PageTemplates installed as a seperate product? It's included in Zope 2.5.1 by default. Try removing the extra PageTemplates product and see if it solves your problem. cheers, Chris From mark@mceahern.com Fri Nov 22 13:34:08 2002 From: mark@mceahern.com (Mark McEahern) Date: Fri, 22 Nov 2002 07:34:08 -0600 Subject: [ZPT] whitespace bug In-Reply-To: <3DDDF88D.8070905@nipltd.com> Message-ID: [Chris Withers] > >>Is that documented anywhere? > > > > I don't know. > > It probably should be. If someone can point me to the right > place, I'll give it a go... A simple section on whitespace in one or more of the following? http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx http://www.zope.org/Documentation/Books/ZopeBook/current/AdvZPT.stx http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx Here's my braindump on this topic... Whitespace ========== What is whitespace? Space, tab, newline, carriage return, line feed. How whitespace is handled in HTML--multiple whitespace is ignored? Other output targets? SQL? Whitespace within a start tag, between attributes, doesn't seem to affect output.
Foobar
Is the same as:
Foobar
Whitespace within a tag ('Foobar' above)... Whitespace surrounding a tag (before
and after
)... Some tags matter more than others. Since is not a block level tag (correct term?), you may be more concerned about whitespace with respect to than with respect to
. Useless blocks to control whitespace... This may matter more/most/only with tal:repeat... Cheers, // mark - From dieter@handshake.de Fri Nov 22 19:01:15 2002 From: dieter@handshake.de (Dieter Maurer) Date: Fri, 22 Nov 2002 20:01:15 +0100 Subject: [ZPT] multiple expressions in tal:condition? In-Reply-To: References: Message-ID: <15838.32507.987744.893459@gargle.gargle.HOWL> Jeff Kowalczyk writes: > I need to test multiple conditions in a tal:condition statement, such as this row > controlling rendering of a formulator form. > > Within: > > neither > You can do the following: ... You can also use "or" when you like. Dieter From skip@pobox.com Fri Nov 22 20:31:40 2002 From: skip@pobox.com (Skip Montanaro) Date: Fri, 22 Nov 2002 14:31:40 -0600 Subject: [ZPT] Macro expand box getting checked against my wishes... In-Reply-To: <3DDDF8F8.6060405@nipltd.com> References: <15837.3909.478407.552800@montanaro.dyndns.org> <3DDDF8F8.6060405@nipltd.com> Message-ID: <15838.37932.955414.558285@montanaro.dyndns.org> >> server is Zope 2.5.1 w/ PageTemplates 1.4.1 on FreeBSD 4.7. Chris> Why do you have PageTemplates installed as a seperate product? Chris> It's included in Zope 2.5.1 by default. It's not my server. I was just reporting what I found. I found PageTemplates 1.4.1 in the lib/python/Products directory. Chris> Try removing the extra PageTemplates product and see if it solves Chris> your problem. Thanks, I'll ask the server admin. If there are some version differences which cause problems (what version of PageTemplates is part of Zope 2.5.1?) will an export followed by an import fix things? Skip From pollej@uleth.ca Fri Nov 22 22:18:22 2002 From: pollej@uleth.ca (Edward Pollard) Date: Fri, 22 Nov 2002 15:18:22 -0700 Subject: [ZPT] ZClass based on Page Templates? Message-ID: <3DDEAD2E.353CB0D5@uleth.ca> I'm trying to make my pages catalog automatically, but to do this I'm told I need to create a ZClass wrapper that is catalog aware. It's pretty easy to do this based off a DTML-Document. No problems. But when I started with Zope I got the impression that DTML was the devil - use Page Templates! I've been using Page Templates for everything to date. I can't seem to base a Zclass off a Page Template, as its not in the list of classes. So, er, how shall I accomplish this? Ed From dieter@handshake.de Sat Nov 23 20:09:47 2002 From: dieter@handshake.de (Dieter Maurer) Date: Sat, 23 Nov 2002 21:09:47 +0100 Subject: [ZPT] ZClass based on Page Templates? In-Reply-To: <3DDEAD2E.353CB0D5@uleth.ca> References: <3DDEAD2E.353CB0D5@uleth.ca> Message-ID: <15839.57483.825599.555625@gargle.gargle.HOWL> Edward Pollard writes: > I'm trying to make my pages catalog automatically, but to do this I'm > told I need to create a ZClass wrapper that is catalog aware. > > It's pretty easy to do this based off a DTML-Document. No problems. > > But when I started with Zope I got the impression that DTML was the > devil - use Page Templates! I've been using Page Templates for > everything to date. I can't seem to base a Zclass off a Page Template, > as its not in the list of classes. Making it available looks somehow like this (taken from "Products/ZCatalog/__init__.py") from ZClasses import createZClassForBase createZClassForBase( ZCatalog.ZCatalog , globals() , 'ZCatalogBase', 'ZCatalog' ) Dieter From chrisw@nipltd.com Mon Nov 25 13:11:10 2002 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 25 Nov 2002 13:11:10 +0000 Subject: [ZPT] Macro expand box getting checked against my wishes... References: <15837.3909.478407.552800@montanaro.dyndns.org> <3DDDF8F8.6060405@nipltd.com> <15838.37932.955414.558285@montanaro.dyndns.org> Message-ID: <3DE2216E.3040209@nipltd.com> Skip Montanaro wrote: > > Chris> Try removing the extra PageTemplates product and see if it solves > Chris> your problem. > > Thanks, I'll ask the server admin. If there are some version differences > which cause problems (what version of PageTemplates is part of Zope 2.5.1?) A newer one ;-) > will an export followed by an import fix things? Just deleting the 1.4.1 thing should be fine. cheers, Chris From erl@telia.com Mon Nov 25 20:06:34 2002 From: erl@telia.com (=?iso-8859-1?Q?Eva_R=E5dahl?=) Date: Mon, 25 Nov 2002 21:06:34 +0100 Subject: [ZPT] vote Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_002A_01C294C6.99CD76D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable for my fantastic doughter Emma R=E5dahl to be Lucia (old tradition in Sweden on the 13th of december) of the town Uppsala in Sweden.=20 =20 You can vote for her if you go to=20 =20 www.unt.se/lucia =20 and click on r=F6sta (wich means vote) under the name Emma R=E5dahl = (the last day to vote is 27 nov.) =20 You can also lissen to her describing herself, but it is in Swedish. =20 You can se 2 larger oicture of her if you go to=20 =20 http://erlboden.cjb.net and a popup come up. Ther will also be lin to the site were you can vote. =20 Thank you =20 /Emmas mother. ------=_NextPart_000_002A_01C294C6.99CD76D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Meddelande
for my=20 fantastic doughter Emma R=E5dahl to be Lucia (old tradition in Sweden on the 13th of = december) of the town Uppsala in Sweden.
 
You = can vote for her=20 if you go to
 
www.unt.se/lucia
=
 
and = click=20 on   r=F6sta (wich means vote) under the name Emma R=E5dahl = (the=20 last day to vote is 27 nov.)
 
You = can also lissen=20 to her describing herself, but it is in Swedish.
 
You = can se 2 larger=20 oicture of her if you go to
 
http://erlboden.cjb.net and=20 a popup come up. Ther will also be lin to the site were you can=20 vote.
 
Thank=20 you
 
/Emmas = mother.
------=_NextPart_000_002A_01C294C6.99CD76D0-- From casey@zope.com Wed Nov 27 14:27:21 2002 From: casey@zope.com (Casey Duncan) Date: Wed, 27 Nov 2002 09:27:21 -0500 Subject: [ZPT] ZClass based on Page Templates? In-Reply-To: <3DDEAD2E.353CB0D5@uleth.ca> References: <3DDEAD2E.353CB0D5@uleth.ca> Message-ID: <200211270927.22001.casey@zope.com> I'm not sure which is more evil, ZClasses or DTML... after some thought, = I'd=20 have to say ZClasses... yes definitely ;^) Caveat Emptor!! A reason why this is likely so is that page templates are not really rega= rded=20 as content objects (whereas DTML Documents were). Now, content is in the = eye=20 of the author, and one man's trash being another's content and all could = mean=20 that in your case your ZPTs are content. I would caution though, that unless your site is all about providing ZPT=20 examples to budding Zope developers, then you are probably mixing your=20 presentation too closely with your content. Usually, content that you Catalog is static data. This data would be pres= ented=20 using page templates (potentially in various ways using multiple template= s).=20 Although it might be beneficial to catalog Page template output, generall= y=20 speaking the raw content is cataloged rather than the page template code = or=20 output. OTOH, feel free to exercise your free will and ignore everything I just s= aid. -Casey On Friday 22 November 2002 05:18 pm, Edward Pollard wrote: > I'm trying to make my pages catalog automatically, but to do this I'm > told I need to create a ZClass wrapper that is catalog aware. >=20 > It's pretty easy to do this based off a DTML-Document. No problems. >=20 > But when I started with Zope I got the impression that DTML was the > devil - use Page Templates! I've been using Page Templates for > everything to date. I can't seem to base a Zclass off a Page Template, > as its not in the list of classes. >=20 > So, er, how shall I accomplish this? >=20 > Ed > From chrisw@nipltd.com Wed Nov 27 18:36:28 2002 From: chrisw@nipltd.com (Chris Withers) Date: Wed, 27 Nov 2002 18:36:28 +0000 Subject: [ZPT] whitespace bug References: Message-ID: <3DE510AC.6020002@nipltd.com> Hi Mark, Sounds like you're in a better position than me to write these docs, care to give it a go? cheers, Chris Mark McEahern wrote: > [Chris Withers] > >>>>Is that documented anywhere? >>> >>>I don't know. >> >>It probably should be. If someone can point me to the right >>place, I'll give it a go... > > > A simple section on whitespace in one or more of the following? > > http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx > > http://www.zope.org/Documentation/Books/ZopeBook/current/AdvZPT.stx > > http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx > > Here's my braindump on this topic... > > Whitespace > ========== > > What is whitespace? Space, tab, newline, carriage return, line feed. > > How whitespace is handled in HTML--multiple whitespace is ignored? Other > output targets? SQL? > > Whitespace within a start tag, between attributes, doesn't seem to affect > output. > >
name='bar'>Foobar
> > Is the same as: > >
Foobar
> > Whitespace within a tag ('Foobar' above)... > > Whitespace surrounding a tag (before
and after
)... > > Some tags matter more than others. Since is not a block level tag > (correct term?), you may be more concerned about whitespace with respect to > than with respect to
. > > Useless blocks to control whitespace... > > This may matter more/most/only with tal:repeat... > > Cheers, > > // mark > > - > > From evan@4-am.com Wed Nov 27 19:26:17 2002 From: evan@4-am.com (Evan Simpson) Date: Wed, 27 Nov 2002 13:26:17 -0600 Subject: [ZPT] Re: whitespace bug In-Reply-To: <3DE510AC.6020002@nipltd.com> References: <3DE510AC.6020002@nipltd.com> Message-ID: <3DE51C59.5070202@4-am.com> Just to give you guys a quick bit of background rationale on the whole whitespace-behaviour thing: Early on in TAL's implementation, somebody or other expressed concern about the aesthetic, as opposed to functional, effects of whitespace in generated text. In response to this, Guido and Fred were careful to try to preserve whitespace where that seemed reasonable, wrap long lines without affecting rendering, etc. The problem under discussion is specific to tal:repeat, and is a side effect of the effort to have template code like this:
...produce text like this:
  • Orange
  • Apple
  • Pear
...rather than this:
  • Orange
  • Apple
  • Pear
In order to accomplish this, tal:repeat's semantics have been bent and slightly fractured -- it not only repeats the tag, but also all of the tag's leading whitespace. The dummy enclosing tag trick eliminates the whitespace, but so does this code: X ...which produces: XOrangeApplePear Cheers, Evan @ 4-am From kevin.j.smith@certen.ca Thu Nov 28 21:44:50 2002 From: kevin.j.smith@certen.ca (SMITH, KEVIN J.) Date: 28 Nov 2002 16:44:50 -0500 Subject: [ZPT] testing for the existence of a variable Message-ID: <1038519897.17256.52.camel@X1517> I am having trouble with the paradigm of ZPT ... I want to set the value of a variable in ZPT only if it isn't already set. The problem is whenever I reference the variable when it has not been set I get an error. This sounds so simple but I have tried many different ways to accomplish this and every time I come up empty handed. example: this is what I want to do ... References: <1038519897.17256.52.camel@X1517> Message-ID: <15846.39335.635741.735291@galsan.espresto.com> > I want to set the value of a variable in ZPT only if it isn't already > set. The problem is whenever I reference the variable when it has not > been set I get an error. This sounds so simple but I have tried many > different ways to accomplish this and every time I come up empty handed. > > example: this is what I want to do ... > > > Does anybody have an elegant solution to this problem? there is a simple trick I have borrowed from page templates in the Silva product (most probably in use a lot elsewhere, too). tal:define="language language | string:french" may do what You want. However it sets the variable if it is defined and the empty string, too, thus You may prefer: tal:define="language exists:language | string:french" Cheers, Clemens From kevin.j.smith@certen.ca Fri Nov 29 18:09:04 2002 From: kevin.j.smith@certen.ca (SMITH, KEVIN J.) Date: 29 Nov 2002 13:09:04 -0500 Subject: [ZPT] testing for the existence of a variable In-Reply-To: <15846.39335.635741.735291@galsan.espresto.com> References: <1038519897.17256.52.camel@X1517> <15846.39335.635741.735291@galsan.espresto.com> Message-ID: <1038593351.17256.67.camel@X1517> Many, many thanks - I have spent many hours trying millions of different ways of doing this to no avail. I love the concept of Zope and ZPT but I find the paradigm shift a bit onerous compared to PHP or ASP or Perl (even with an object oriented background) However, I'm sticking with it in the hopes it will pay big dividends!! Cheers On Thu, 2002-11-28 at 17:33, Clemens Robbenhaar wrote: > > > > I want to set the value of a variable in ZPT only if it isn't already > > set. The problem is whenever I reference the variable when it has not > > been set I get an error. This sounds so simple but I have tried many > > different ways to accomplish this and every time I come up empty handed. > > > > example: this is what I want to do ... > > > > > > > Does anybody have an elegant solution to this problem? > > there is a simple trick I have borrowed from page templates in the Silva > product (most probably in use a lot elsewhere, too). > > tal:define="language language | string:french" > > may do what You want. However it sets the variable if it is defined and > the empty string, too, thus You may prefer: > > tal:define="language exists:language | string:french" > > Cheers, > Clemens > From zope@thewebsons.com Sat Nov 30 10:47:30 2002 From: zope@thewebsons.com (beno) Date: Sat, 30 Nov 2002 06:47:30 -0400 Subject: [ZPT] Simple Variable Call Message-ID: <5.1.0.14.0.20021130064536.00b29300@mail.thewebsons.com> Hi; Here's two lines of code from a Page Template: This is Page Template template id.

In the latter line I want to call the same_variable referenced in the former line (template/id or template.id). How do I do it? TIA, beno