[PHPTAL] trouble with ne and strings
Walter Cruz
walter.php at gmail.com
Sat Jun 16 16:48:37 CEST 2007
Hi all. I want to display the dates of the news on the screen only if
the date changed. I have the following template:
<span tal:define="global lastdate string:walter" />
<span tal:omit-tag="" tal:repeat="noticia noticias/data">
<h2 tal:content="noticia/materia_publicacao" >text replaced by item</h2>
<h2 tal:content="lastdate" >text replaced by item</h2>
<p tal:condition="php: lastdate ne noticia.materia_publicacao">
aqui
<span tal:define="global lastdate noticia/materia_publicacao" />
</p>
<!-- <p tal:replace="noticia/materia_hora" >text replaced by item</p>
<a tal:attributes="href noticia/materia_id"
tal:content="noticia/materia_titulo"></a>-->
</span>
But the tal:condition always return true!
What I can't understand, is that the h2 tags in the loop displays the
same! (I have 2 articles on the same date)
<h2>2007-03-29</h2>
<h2>2007-03-29</h2>
<p>
aqui
</p>
Can someone help me?
[]'s
- Walter
More information about the PHPTAL
mailing list