Hello.
in the documentation on how to encode PDFs there seem to be two versions.
In https://www.espocrm.com/documentatio...-each-iterator
there is this example:
<table>
<!-- {{#each itemList}} -->
<tr>
<td>{{name}}</td>
</td>{{amount}}</td>
</tr>
<!-- {{/each}} -->
</table>
In https://www.espocrm.com/documentatio...content-tables there is this other coding
{{#tableTag width="80%" border="0.5pt" cellpadding="4"}}
{{#each opportunities}}
{{#trTag}}
{{#tdTag width="40%"}}{{name}}{/tdTag}}
{{#tdTag width="30%"}}{{assignedUserName}}{/tdTag}}
{{#tdTag width="30%" align="right"}}{{stage}}{{/tdTag}}
{{/trTag}}
{{/each}}
{{/tableTag}}
the differences on how to code are manifold:
In the first case {{ is used only in some instructions and those with <!--
The # is incorporated in all instructions
the Tag suffix is used. This is the only thing that is mentioned. Nothing said on the other two issues
i have my templates coded as the first versions and they work perfectly, but I see the second is recommended
I would like to know if you can use both versions of the code indistinctly or I must update my templates
Best regards
PD Example of one of my codings:
{{! LISTA DE LAS CAJAS BOXSPACE}}
<table width="100%" border="1px solid black" cellpadding="3" class="table table-bordered">
<thead>
<tr style="background-color:#085294;color:#FFFFFF;">
<td colspan="5" align="center"><b>CAJAS BOXSPACE</b></td>
</tr>
<tr style="font-size:10pt; background-color:#085294;color:#FFFFFF;">
<td width="10%" align="center" style="font-weight: bold;">Campo 1<br>Pedido</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 2<br>Cód. UniBox</td>
<td width="20%" align="center" style="font-weight: bold;">Campo 3<br>Referencia</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 4<br>Tipo</td>
</tr>
</thead>
<tbody>
<!-- {{#each lGOrdenLineas}} -->
<!-- {{#if lGSuscripcionDescripcion}} -->
<!-- {{else}} -->
<tr style="font-size:10pt;">
<td width="10%" align="center">{{../name}}</td>
<td width="35%"> </td>
<td width="20%" align="center">{{lGSuscripcion}}</td>
<td width="35%">{{lGTipoProducto}}</td>
</tr>
<!-- {{/if}} -->
<!-- {{/each}} -->
</tbody>
</table>
{{! LISTA DEL RESTO DE COSAS}}
<table width="100%" border="1px solid black" cellpadding="3" class="table table-bordered">
<thead>
<tr style="background-color:#085294;color:#FFFFFF;">
<td colspan="5" align="center"><b>OTROS PRODUCTOS DEL PEDIDO</b></td>
</tr>
<tr style="font-size:10pt; background-color:#085294;color:#FFFFFF;">
<td width="10%" align="center" style="font-weight: bold;">Campo 1<br>Pedido</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 2<br> Cód. UniBox</td>
<td width="20%" align="center" style="font-weight: bold;">Campo 3<br>Referencia</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 4<br>Descripción</td>
</tr>
</thead>
<tbody>
<!-- {{#each lGOrdenLineas}} -->
<!-- {{#if lGSuscripcionDescripcion}} -->
<tr style="font-size:10pt;">
<td width="10%" align="center">{{../name}}</td>
<td width="35%"> </td>
<td width="20%" align="center">{{lGSuscripcion}}</td>
<td width="35%">Otros: {{lGSuscripcionDescripcion}}</td>
</tr>
<!-- {{/if}} -->
<!-- {{/each}} -->
</tbody>
</table>
in the documentation on how to encode PDFs there seem to be two versions.
In https://www.espocrm.com/documentatio...-each-iterator
there is this example:
<table>
<!-- {{#each itemList}} -->
<tr>
<td>{{name}}</td>
</td>{{amount}}</td>
</tr>
<!-- {{/each}} -->
</table>
In https://www.espocrm.com/documentatio...content-tables there is this other coding
{{#tableTag width="80%" border="0.5pt" cellpadding="4"}}
{{#each opportunities}}
{{#trTag}}
{{#tdTag width="40%"}}{{name}}{/tdTag}}
{{#tdTag width="30%"}}{{assignedUserName}}{/tdTag}}
{{#tdTag width="30%" align="right"}}{{stage}}{{/tdTag}}
{{/trTag}}
{{/each}}
{{/tableTag}}
the differences on how to code are manifold:
In the first case {{ is used only in some instructions and those with <!--
The # is incorporated in all instructions
the Tag suffix is used. This is the only thing that is mentioned. Nothing said on the other two issues
i have my templates coded as the first versions and they work perfectly, but I see the second is recommended
I would like to know if you can use both versions of the code indistinctly or I must update my templates
Best regards
PD Example of one of my codings:
{{! LISTA DE LAS CAJAS BOXSPACE}}
<table width="100%" border="1px solid black" cellpadding="3" class="table table-bordered">
<thead>
<tr style="background-color:#085294;color:#FFFFFF;">
<td colspan="5" align="center"><b>CAJAS BOXSPACE</b></td>
</tr>
<tr style="font-size:10pt; background-color:#085294;color:#FFFFFF;">
<td width="10%" align="center" style="font-weight: bold;">Campo 1<br>Pedido</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 2<br>Cód. UniBox</td>
<td width="20%" align="center" style="font-weight: bold;">Campo 3<br>Referencia</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 4<br>Tipo</td>
</tr>
</thead>
<tbody>
<!-- {{#each lGOrdenLineas}} -->
<!-- {{#if lGSuscripcionDescripcion}} -->
<!-- {{else}} -->
<tr style="font-size:10pt;">
<td width="10%" align="center">{{../name}}</td>
<td width="35%"> </td>
<td width="20%" align="center">{{lGSuscripcion}}</td>
<td width="35%">{{lGTipoProducto}}</td>
</tr>
<!-- {{/if}} -->
<!-- {{/each}} -->
</tbody>
</table>
{{! LISTA DEL RESTO DE COSAS}}
<table width="100%" border="1px solid black" cellpadding="3" class="table table-bordered">
<thead>
<tr style="background-color:#085294;color:#FFFFFF;">
<td colspan="5" align="center"><b>OTROS PRODUCTOS DEL PEDIDO</b></td>
</tr>
<tr style="font-size:10pt; background-color:#085294;color:#FFFFFF;">
<td width="10%" align="center" style="font-weight: bold;">Campo 1<br>Pedido</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 2<br> Cód. UniBox</td>
<td width="20%" align="center" style="font-weight: bold;">Campo 3<br>Referencia</td>
<td width="35%" align="center" style="font-weight: bold;">Campo 4<br>Descripción</td>
</tr>
</thead>
<tbody>
<!-- {{#each lGOrdenLineas}} -->
<!-- {{#if lGSuscripcionDescripcion}} -->
<tr style="font-size:10pt;">
<td width="10%" align="center">{{../name}}</td>
<td width="35%"> </td>
<td width="20%" align="center">{{lGSuscripcion}}</td>
<td width="35%">Otros: {{lGSuscripcionDescripcion}}</td>
</tr>
<!-- {{/if}} -->
<!-- {{/each}} -->
</tbody>
</table>
Comment