Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

how detect a variable from template father?

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


yourpadre at gmail

Jun 24, 2009, 3:17 PM

Post #1 of 2 (927 views)
Permalink
how detect a variable from template father?

Hi list

I have 2 templates, in second template I need render a <span> only when the
first template have defined a variable.

template1:
<ul tal:define="var1 python:1">
<li tal:replace="structure conext/template2"></li>
<li tal:replace="structure python:conext.template2(var2=1)"></li>
</ul>

template2:
<li>
<input id="x" name="x" value="somevalue">
<span tal:condition="exists: var1">span2</span>
<span tal:condition="exists: attr/var1">span2</span>
<span tal:condition="exists: context/var1">span2</span>
<span tal:condition="exists: container/var1">span2</span>
<span tal:condition="exists: options/var2">span3</span>
</li>

any condition in span not work :(

--
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida


lists at zopyx

Jun 24, 2009, 3:19 PM

Post #2 of 2 (829 views)
Permalink
Re: how detect a variable from template father? [In reply to]

On Thu, Jun 25, 2009 at 00:17, Miguel Beltran R. <yourpadre [at] gmail>wrote:

> Hi list
>
> I have 2 templates, in second template I need render a <span> only when the
> first template have defined a variable.
>
> template1:
> <ul tal:define="var1 python:1">
> <li tal:replace="structure conext/template2"></li>
> <li tal:replace="structure python:conext.template2(var2=1)"></li>
> </ul>
>
> template2:
> <li>
> <input id="x" name="x" value="somevalue">
> <span tal:condition="exists: var1">span2</span>
> <span tal:condition="exists: attr/var1">span2</span>
> <span tal:condition="exists: context/var1">span2</span>
> <span tal:condition="exists: container/var1">span2</span>
> <span tal:condition="exists: options/var2">span3</span>
> </li>
>
> any condition in span not work :(
>

The 'options' namespace is your friend.

-aj

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.