[ZPT] Re: building a href in zpt

Wolfram Kraus kraus at hagen-partner.de
Fri Jun 17 03:10:59 EDT 2005


Kenneth Gonsalves wrote:
> hi,
> i have a postgres table like so:
> 
> id integer
> name varchar
> 
> i want to list the contents of the table and build an href like this:
> 
> <a href="foo.bar.com/edit?id=someid">name</a>
> 
> my zpt code so far is:
> 
> <a tal:attributes="href string:${portal_url}/editdemo?="
>  tal:content="result/name">name</a>
> 
> but i cant figure out how to insert the tal:contern="result/id" after 
> the '?='
> 
> any clues?
> 
> 

Just use the path-expression result/id in "string:":
<a tal:attributes="href string:${portal_url}/editdemo?id=${result/id}"
   tal:content="result/name">name</a>

See: http://www.plope.com/Books/2_7Edition/AdvZPT.stx#2-12

HTH,
Wolfram



More information about the ZPT mailing list