<div>Only problem is I am using a dtml-in inside the category_results method which calls a sql method and it now gives me an error:</div>
<div><dtml-in expr="category_match1(_)" size=50 start=query_start><br>...</div>
<div></dtml-in></div>
<div> </div>
<div>Perhaps its not finding the title1 value I am trying to pass to it?</div>
<div> </div>
<div><strong>Error Type: NameError<br>Error Value: global name 'category_match1' is not defined</strong><br> </div>
<div><span class="gmail_quote">On 8/29/05, <b class="gmail_sendername">Peter Bengtsson</b> <<a href="mailto:peterbe@gmail.com">peterbe@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Better<br><br><dtml-let orig_title="'Hannoverian Stallions Lauries Crusador ' "><br><dtml-with links>
<br><dtml-var "catagory_results(_, _.None, title1=orig_title)"><br></dtml-with><br></dml-let><br><br>Use dtml-let and notice the extra _ in the parameters. I doubt that<br>DTML methods accept plain arguments except self, REQUEST and RESPONSE.
<br>All other things must be passed with keyword arguments.<br><br><br>On 8/30/05, Sean Kelley <<a href="mailto:kelleyfarm@gmail.com">kelleyfarm@gmail.com</a>> wrote:<br>> I tried using orig_title in the format <dtml-var orig_title> in the called
<br>> dtml-method (category_results) and I get a zope error which I don't<br>> understand:<br>> Error Type: TypeError<br>> Error Value: sequence index must be integer<br>><br>> When I call it in the orignal page which I want the title for it works fine.
<br>><br>><br>> John Eikenberry jae-zope at <a href="http://kavi.com">kavi.com</a><br>> Mon Aug 29 16:05:37 EDT 2005<br>><br>><br>><br>> Previous message: [Zope] passing a parameter - namespace and dtml-with
<br>> Next message: [Zope] zope 2.8 command line tracebacks<br>> Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]<br>> ________________________________<br>> Sean Kelley wrote:<br>><br>> > I am trying to pass the title of a page to a dtml method which is in
<br>> another<br>> > folder named links. If I pass the actual title like below everything<br>> works.<br>> > However, when I try to pass the value of the current title to<br>> > category_results using various other methods it does not.
<br>> > What is the syntax so that I can pass the current value of <dtml-var<br>> title><br>> > to the method? Would the dtml-with block change the namespace it pulls the<br>> > title variable from to the context of the method category_results in the
<br>> > links folder?<br>><br>> Yes.<br>><br>> Here's a quick hack that will work.<br>><br>> <dtml-call "REQUEST.set('orig_title',this().title)"><br>> <dtml-with links><br>
> <dtml-var "catagory_results(_.None,REQUEST.get('orig_title'))"><br>> </dtml-with><br>><br>> > <dtml-with links><br>> > <dtml-comment>This line works</dtml-comment>
<br>> > <dtml-var "category_results(_.None, _, title1='Hannoverian Stallions<br>> Lauries<br>> > Crusador ')"><br>> > </dtml-with><br>><br>><br>><br>><br>> _______________________________________________
<br>> Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>> <a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</a><br>> ** No cross posts or HTML encoding! **
<br>> (Related lists -<br>> <a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>> <a href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev
</a> )<br>><br>><br>><br><br><br>--<br>Peter Bengtsson,<br>work <a href="http://www.fry-it.com">www.fry-it.com</a><br>home <a href="http://www.peterbe.com">www.peterbe.com</a><br>hobby <a href="http://www.issuetrackerproduct.com">
www.issuetrackerproduct.com</a><br></blockquote></div><br><br clear="all"><br>-- <br>Sean Kelley<br>