odooissuu

Qweb value inside code in odoo website view


How can i get die value of a field folder.x_code inside a div script data-configid

<t t-foreach="website.env['x_folders'].search([])" t-as="folder"> <!-- BEGINLOOP -->
              <t t-if="folder.x_actief">
              <div class="col-md-4 text-center">
                <div class="box">
                  <div class="box-content">
                      <h1 t-field="folder.x_name" style="font-size: medium"/>
                    <hr/>

<div data-configid="<t t-esc="folder.x_code"/>" 
style="width:100%; height:371px;" class="issuuembed"></div>                       
                    <script type="text/javascript" src="//e.issuu.com/embed.js" async="true"></script>
                    <br/>
                  </div>
                </div>
              </div>
              </t></t>

Solution

  • The solution thx to Veikko

    <t t-foreach="website.env['x_folders'].search([])" t-as="folder">
      <t t-if="folder.x_actief">
         <div class="col-md-4 text-center">
          <div class="box">
            <div class="box-content">
              <h1 t-field="folder.x_name" style="font-size: medium"/>
              <hr/>
              <div t-attf-data-configid="{{folder.x_code}}" style="width:100%; height:371px;" class="issuuembed"></div>                       
              <script type="text/javascript" src="//e.issuu.com/embed.js" async="true"></script>
              </div>
           </div>
           </div>
          </t>
        </t>