[TYPO3-project-formidable] Template Engine: Bug when using isLoggedIn().isFalse() twice

Hauke Hain newgrp at googlemail.com
Wed Feb 25 18:18:53 CET 2009


Hi,

I am using Formidable 2.320.

I used this example:
http://formidable.typo3.ug/features/template-engine/overview.html

I only changed the Template to this:
<!-- ###MAIN### begin-->

 <h4><span>This will display the renderlet in default-mode</span></h4>
 <p>{mytxt}</p>

 <h4><span>Here, we recombine the label and the input</span></h4>
 <p>{mytxt.input} {mytxt.label.tag}</p>

 <h4><span>To know what data is available, we execute debug()</span></h4>
 <p>{mytxt.debug()}</p>

 <h4><span>Now, a lot of template method are available on each 
data</span></h4>
 <p><b>upper() on the label:</b> {mytxt.label.upper()}</p>
 <p><b>lower() on the label:</b> {mytxt.label.lower()}</p>
 <p><b>ucwords() on the label:</b> {mytxt.label.ucwords()}</p>
 <p><b>wrap("This is before | and this is after".upper()) on the 
previous:</b>
{mytxt.label.ucwords().wrap("This is before | this is after".upper())}</p>

 <!-- ###isLoggedIn().isFalse() perimeter### begin-->
 <h4><span>Template methods allow conditioning some data</span></h4>
 <p>{mytxt.label.lower().equals("some text field").isTrue().echo("this 
condition is true")}</p>
 <!-- ###isLoggedIn().isFalse() perimeter### end-->

 <h4><span>Now, it's also possible to condition the display of whole parts 
of the HTML using "perimeters"</span></h4>

 <!-- ###mytxt.label.equals("abcdef") perimeter### begin-->
  <div class="notice">
   <p>This DIV will <b>not</b> be displayed</p>
  </div>
 <!-- ###mytxt.label.equals("abcdef") perimeter### end-->

 <!-- ###mytxt.label.equals("abcdef").isFalse() perimeter### begin-->
  <div class="notice">
   <p>This DIV <b>will</b> be displayed</p>
  </div>
 <!-- ###mytxt.label.equals("abcdef").isFalse() perimeter### end-->

 <!-- ###isLoggedIn().isFalse() perimeter### begin-->
  <div class="notice">
   <p>Different Text</p>
  </div>
 <!-- ###isLoggedIn().isFalse() perimeter### end-->

<!-- ###MAIN### end-->


If you test it you'll see that everything between the first <!--  
###isLoggedIn().isFalse() perimeter### begin-->
and  last  <!-- ###isLoggedIn().isFalse() perimeter### end--> is handled as 
one block.


The problem lies in the function function _parseTemplate of 
class.tx_ameosformidable.php called from $sForm = 
$this->oForm->_parseTemplateCode in class.tx_rdrtemplate.php .



I am looking where the error lies for a long time now.

I'll debug a little further, but as usual: Help is appreciated!

Regards,
Hauke

PS: I have this bug only with isLoggedIn().isFalse() not with other 
functions...



More information about the TYPO3-project-formidable mailing list