Re: [Zope] dtml-with syntax question
Tim Cook writes: I'm sure someone will correct me if I'm wrong. But I believe you want: dtml-with "_.getitem(attribute3)" Haven't tried it in my code yet, but thanks to your post I found the section about _.getitem(). That'll come in handy all over the place, so many thanks for the pointer! //glw ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] dtml-with syntax question
Chris Withers writes: "Geoffrey L. Wright" wrote: Where objectName2 is actually an attribute of objectName1. dtml-with objectName1 dtml-var attribute1 dtml-var attribute2 dtml-var attribute3 dtml-with objectName2 dtml-var attribute1 /dtml-with /dtml-with The above should now work... ...if it doesn't please explain in what way ;-) Hmmm... OK. Here is my relevant code, complete with resulting error message: dtml-with sidebar_item dtml-var attribute1 dtml-var attribute2 etc... dtml-with gsi_content dtml-with inventory dtml-with attribute3 dtml-var short_desc /dtml-with /dtml-with /dtml-with /dtml-with sidebar_item And Zope sez: Error Type: KeyError Error Value: short_desc attribute1, attribute2 and attribute3 are all attributes of sidebar_item. If I change the dtml-with attribute3 to read dtml-with weepee_the_weewee (where weepee_the_weewee is the actual name of the object I'm trying to refer to), then I see the short_desc attribute of weepee_the_weewee perfectly. Don't I have to do something in my syntax to indicate that I'm looking for the the value of attribute3 rather than an object with the literal id "attribute3"? cheers, Chris Dazed Confused, //glw ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] dtml-with syntax question
"\"Geoffrey L. Wright\" Don't I have to do something in my syntax to indicate that I'm looking for the the value of attribute3 rather than an object with the literal id "attribute3"? I'm sure someone will correct me if I'm wrong. But I believe you want: dtml-with "_.getitem(attribute3)" -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT Free Practice Management Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] DTML entity syntax: was Nested properties (addition)
On 27 Sep 2000, 12:46 Lars Heber wrote: I forgot something: By the way: Is it possible to insert special characters in properties, like auml;? I meant, that properties with special characters in it are not displayed correctly, when called with the shortened syntax dtml-VARNAME;. Are special characters not allowed in the short syntax? auml; - amp;auml; See How-To: Using the DTML entity syntax snip The entity notation is an alternate syntax for the dtml-var tag. It is available since Zope 2.0. Here is a text snippet from the ZopeDir\doc\CHANGES.txt file for the 2.0.1 distribution (in a slightly adapted form) that explains it all: Zope 2.0 introduces a new HTML DTML syntax that, among other things, allows simple 'var' tags to be entered using the entity-reference syntax, as in: input name=myVar value="dtml-myVar;" The entity reference syntax is mainly intended for use when a var tag is used to insert text into an HTML tag. In these cases, the text needs to be html-quoted. For this reason, use of the entity reference syntax now implies html quoting. For example, the DTML snippet above is equivalent to: input name=myVar value="dtml-var myVar html_quote" -- o ( [EMAIL PROTECTED] (+49 2241) 14-2394 /\* GMD mbH #include _`\ `_=== Schloss Birlinghoven, std.disclaimer __(_)/_(_)___.-._ 53754 Sankt Augustin, Germany ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] dtml-in syntax
Would this do it? : dtml-let item=0 dtml-in wherever dtml-let level="level+1" /dtml-in /dtml-let Cheers, Manuel On Sat, 29 Jul 2000, Tim Cook wrote: Kyle Burnett wrote: so i have this loop and i want to count a variable: dtml-in wherever dtml-if sequence-start dtml-var count-id /dtml-if /dtml-in but what i really want to count is specific values for id. so let's say id=='value1', i want to try and do the following: dtml-in wherever dtml-if sequence-start dtml-var "count-id=='value1'" /dtml-if /dtml-in but no luck. and i have tried several other make-shift syntaxes to no avail. i do have some other logic that i could use over the course of the loop to determine the count of distinct values but i was try to do it in far less code. This may be what you already thought of. It does require a lot of code if you have several things to count. There may also be cleaner ways to do it??? dtml-call "REQUEST.set('this_count', 0)" dtml-in wherever dtml-call "REQUEST.set('current_id', _['sequence-item'])" dtml-if "current_id=='id_to_count'" dtml-call "REQUEST.set('this_count', this_count+1)" /dtml-if current_id /dtml-in wherever I counted dtml-var this_count items. (of course this is untested)g. -- Tim Cook -- FreePM Project Coordinator - http://www.freepm.org OS Healthcare Alliance Supporter - http://www.oshca.org ___ Zope maillist - [EMAIL PROTECTED] 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 ) ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] dtml-in syntax
Kyle Burnett wrote: so i have this loop and i want to count a variable: dtml-in wherever dtml-if sequence-start dtml-var count-id /dtml-if /dtml-in but what i really want to count is specific values for id. so let's say id=='value1', i want to try and do the following: dtml-in wherever dtml-if sequence-start dtml-var "count-id=='value1'" /dtml-if /dtml-in but no luck. and i have tried several other make-shift syntaxes to no avail. i do have some other logic that i could use over the course of the loop to determine the count of distinct values but i was try to do it in far less code. This may be what you already thought of. It does require a lot of code if you have several things to count. There may also be cleaner ways to do it??? dtml-call "REQUEST.set('this_count', 0)" dtml-in wherever dtml-call "REQUEST.set('current_id', _['sequence-item'])" dtml-if "current_id=='id_to_count'" dtml-call "REQUEST.set('this_count', this_count+1)" /dtml-if current_id /dtml-in wherever I counted dtml-var this_count items. (of course this is untested)g. -- Tim Cook -- FreePM Project Coordinator - http://www.freepm.org OS Healthcare Alliance Supporter - http://www.oshca.org ___ Zope maillist - [EMAIL PROTECTED] 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 )