JQuery Tmpl If statement prints me both the IF and ELSE answer

3.2k Views Asked by At

I have a problem with IF statement in JQuery Tmpl. I call it like so:
$('#tmplDialogWindow').tmpl([{title: title, yn: 'y'}])

and the code looks like so:

<script id="tmplDialogWindow" type="text/x-jquery-tmpl">  
   <h2>${title}</h2>  
   <p>Some cool text that You, 
   {{if yn == 'y'}}  
      want  
   {{else}}  
      don't want  
   {{/if}}  
   to see.</p>  
   Wpisz tekst lub frazę: <input type='text' name='qText' id='inputetText'>  
</script>

And it prints me both the IF and ELSE answer. What's up?

Edit of 17/02/2011:

I am using modx framework and it (the modx) changes {{sth}} to load the sth chunks (which are the HTML block codes).

I must find a way to change the {{}} to some different tags.

0

There are 0 best solutions below