DTML to ZPT: insert db info and variables help
Hi, Can someone please help me to convert the dtml into zpt. below i am adding a db item onto the end of a url. maybe there is a URL example but i couldnt find one that worked. <a href=update?item=<dtml-var product>>Edit <dtml-var product></a> Also placing db info into input fields.. i cant get head around tales... <dtml-in zSQLMethod> <form method="post" action="update_files" enctype="multipart/form-data"> <input type="hidden" name=product_title value="<dtml-var product_title null="">" </form> <dtml-in> thanks all, Conno __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
I haven't tested these, but this should point you in the right direction. I think the main thing you're looking for is the "tal:attributes" attribute. Kevin Wayne Connolly wrote:
<a href=update?item=<dtml-var product>>Edit <dtml-var product></a>
<a href="whatever" tal:attributes="href string:update?item=${here/product}" tal:content="string:Edit ${here/product}">Edit</a>
<dtml-in zSQLMethod> <form method="post" action="update_files" enctype="multipart/form-data">
<input type="hidden" name=product_title value="<dtml-var product_title null="">" </form> <dtml-in>
<div tal:define="inData here/zSQLMethod"> <form method="post" action="update_files" enctype="multipart/form-data"> <input type="hidden" name="whatever" value="whatever" tal:attributes="name python:inData[0].product_title; value python:inData[0].product_title"> </form> </div> Hope that helps, Kevin
Wayne Connolly wrote:
Hi, Can someone please help me to convert the dtml into zpt. below i am adding a db item onto the end of a url. maybe there is a URL example but i couldnt find one that worked.
I hope this helps
<a href=update?item=<dtml-var product>>Edit <dtml-var product></a>
<a href="#" tal:attributes="href string:update?item=${here/product}" tal:content="string:Edit ${here/product}">Edit</a>
Also placing db info into input fields.. i cant get head around tales...
<dtml-in zSQLMethod> <form method="post" action="update_files" enctype="multipart/form-data">
<input type="hidden" name=product_title value="<dtml-var product_title null="">" </form> <dtml-in>
<form method="post" action="update_files" enctype="multipart/form-data" tal:repeat="item here/zSQLMethod"> <input type="hidden" name=product_title tal:attributes="value here/product_title"> </form> regards Max M
participants (3)
-
Kevin Carlson -
Max M -
Wayne Connolly