[ZPT] pass parameter in href

Fred Drake fdrake at gmail.com
Tue Aug 23 10:08:39 EDT 2005


On 8/23/05, celtek at wp.pl . <celtek at wp.pl> wrote:
> In 2.zpt I have:
> <!--tal:define="value python:context.REQUEST.get('firstValue')"-->  this 'firstValue' come from 1.zpt
> I want to pass this integer ' value '  into script using link in 2.zpt:
> <!--   <a href="script?value=??">Indeks</a>    -->
> but I can't figured out what I should insert in place of  this question marks
> When I insert :
> <!--  <a href="script?value=value">Indeks</a>    -->
> I receive only word ' value ' not integer value depending on what was 'firstValue'.

I'm just guess that you don't really want it all in a comment.  :-)

Try this:

    <div tal:define="value request/firstValue">
      <!-- Whatever else uses value can go in here too. -->
      <a tal:attributes="href string:script?value=${value}">Indeks</a>
    </div>


  -Fred

-- 
Fred L. Drake, Jr.    <fdrake at gmail.com>
Zope Corporation


More information about the ZPT mailing list