PDA

View Full Version : Xtemplate



Jad
20 Nov 2012, 8:08 AM
Hello

I have an Xtemplate like this :



<tpl for="invoice.items">
<tr><td>{name} du {description.startDate} au {description.endDate}</td>
<td><tpl if="description.prices">
<ul><tpl for="description.prices">
<li>Tarification {tariffingYear} {price} {parent.description.currency}</li>
</tpl></ul>
</tpl>

<tpl if="description.fees">
<strong>Frais</strong>
<ul><tpl for="description.fees">
<li>{name}
<ul><tpl for="prices">
<li>Tarification {tariffingYear} {price} {parent.parent.description.currency}</li> </tpl></ul>
</li>
</tpl></ul>
</tpl>

<tpl if="description.seasons">
<strong>Saisons</strong>
<ul><tpl for="description.seasons">
<li>du {startDate} au {endDate}
<ul>
<li>Tarification {tariffingYear} {price.price} {[parent.parent.description.currency]</li></ul>
</li>
</tpl></ul>
</tpl>
</td>
<td align="right">{amount}</td>
</tr>
</tpl>


parent.parent.description.currency not work.

How to do that ?

Thanks a lot :-)

Farish
20 Nov 2012, 8:29 AM
there seems to be a syntax error here:


<li>Tarification {tariffingYear} {price.price} {[parent.parent.description.currency]</li></ul> </li>

Jad
20 Nov 2012, 8:34 AM
I'm sorry it doe's not work better

Jad
20 Nov 2012, 11:59 PM
I'm in the description.fees.prices node and i want to accede to description.currency

Jad
21 Nov 2012, 12:39 AM
What about this solution

<tpl if="description.fees">
<strong>Frais</strong>
<ul><tpl for="description.fees">
<li>{name}
<ul><tpl for="prices">
<li>Tarification {tariffingYear} {price} {[r2.description.currency]}</li>
</tpl></ul>
</li>
</tpl></ul>
</tpl>