How to assign value to attributes in jsRender template?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Ondra
User
Posts: 4

How to assign value to attributes in jsRender template?

Post by Ondra »

Good day all. If anyone can help thanks in advance.
When using the following : <div class="tk" data-amount="{{{varWaterHeight}}}">
It produces the following: <div class="tk" data-amount="<slot class=" ew-slot"="" name="tpx1_vw_customer_status_res_2_varWaterHeight">
In the example below using: {{{varWaterHeight}}} on its own works as expected.
How do I correctly assign the value to the attribute date-amount?

This

<div class="tk" data-amount="{{{varWaterHeight}}}">
        {{{MnWtHtFootInches}}} <br> {{{varWaterHeight}}} <br> {{{varTankText}}}
 <div class="lq"></div></div>

Produces the following: -

<div class="tk" data-amount="<slot class=" ew-slot"="" name="tpx1_vw_customer_status_res_2_varWaterHeight">"&gt;
   <span id="el1_vw_customer_status_res_2_MnWtHtFootInches" class="el_vw_customer_status_res_2_MnWtHtFootInches">
<span>7.19</span>
</span> <br> <span id="el1_vw_customer_status_res_2_varWaterHeight" class="el_vw_customer_status_res_2_varWaterHeight">
<span>47</span>
</span> <br> <span id="el1_vw_customer_status_res_2_varTankText" class="el_vw_customer_status_res_2_varTankText">
<span>FT / INS</span>
</span>
<div class="lq"></div>
</div>

arbei
User
Posts: 9384

Post by arbei »


Ondra
User
Posts: 4

Post by Ondra »

I took a look at the link.
The issue was never solved.


arbei
User
Posts: 9384

Post by arbei »

You better try my answer yourself first. (Replace the attribute name by yours.)

Note that your tag {{{varWaterHeight}}} is wrong. {{{fieldname}}} is original HTML of the field, you cannot put HTML inside attribute. Read Custom Template Tags for details.


Post Reply