Hey all, I think I'm doing something wrong, because I'm trying to use the conditionals inside the html tags when I make a pdf template, that is, I have this code
<table>
<tbody>
<tr>
<td>one</td>
<td>two</td>
</tr>
</tbody>
</table>
And I check the value of a field on my entity called {{closed}} posible values "yes", "no".
The problem is, I try to make a if inside table like
<table>
<tbody>
<tr>
{{#if closed "yes"}}
<td>oke is yes</td>
{{else}}
<td>oke is no</td>
</tr>
</tbody>
</table>
when I saved and try to check printing got wrong, so I open the template again and my code is like this
{#if closed "yes"}}
{{else}}
<table>
<tbody>
<tr>
<td>oke is yes</td>
<td>oke is no</td>
</tr>
</tbody>
</table>
The questions is, How can I put conditionals inside tables, also I try on other entity something like this
<table style="width: 100%;">
<tbody>
<tr iterate="{{contacts}}">
<td>{{name}}</td>
<td>{{assignedUserName}}</td>
</tr>
<tr>
{{#if closed "yes"}}
<td>oke is yes</td>
{{else}}
<td>oke is no</td>
</tr>
</tbody>
</table>
and get the same result
{{#if closed "yes"}}
{{else}}
<table style="width: 100%;">
<tbody>
<tr iterate="{{contacts}}">
<td>{{name}}</td>
<td>{{assignedUserName}}</td>
</tr>
<tr>
<td>oke is yes</td>
<td>oke is no</td>
</tr>
</tbody>
</table>
thx for ur help
<table>
<tbody>
<tr>
<td>one</td>
<td>two</td>
</tr>
</tbody>
</table>
And I check the value of a field on my entity called {{closed}} posible values "yes", "no".
The problem is, I try to make a if inside table like
<table>
<tbody>
<tr>
{{#if closed "yes"}}
<td>oke is yes</td>
{{else}}
<td>oke is no</td>
</tr>
</tbody>
</table>
when I saved and try to check printing got wrong, so I open the template again and my code is like this
{#if closed "yes"}}
{{else}}
<table>
<tbody>
<tr>
<td>oke is yes</td>
<td>oke is no</td>
</tr>
</tbody>
</table>
The questions is, How can I put conditionals inside tables, also I try on other entity something like this
<table style="width: 100%;">
<tbody>
<tr iterate="{{contacts}}">
<td>{{name}}</td>
<td>{{assignedUserName}}</td>
</tr>
<tr>
{{#if closed "yes"}}
<td>oke is yes</td>
{{else}}
<td>oke is no</td>
</tr>
</tbody>
</table>
and get the same result
{{#if closed "yes"}}
{{else}}
<table style="width: 100%;">
<tbody>
<tr iterate="{{contacts}}">
<td>{{name}}</td>
<td>{{assignedUserName}}</td>
</tr>
<tr>
<td>oke is yes</td>
<td>oke is no</td>
</tr>
</tbody>
</table>
thx for ur help
Comment