18 Replies Latest reply on Dec 9, 2012 1:50 PM by kenneth_rapp

    webapp {tag_description} won't render in JS

    M. Adey Level 1

      Hi

       

      I need to show some news in a two column format. Left with a title, image and 300 caracters coming from {tag_description} and

      he right column is a list of the rest of the news with title and 100 caracters from the description field.

       

      I have created a webapps with the fields and creatred a testpage which contain this

       

      <div id="content">

      <div id="headline"">

          <div id="news1-header">

       

       

          </div>

      <div id="news1-image">

         

      </div>

      <div id="news1-body">

       

      </div>

      </div>

       

       

      <div id="news2">

          <div id="news2-header">

          </div>

      <div id="news2-body">

          </div>

      </div>

          <div id="news3">

          <div id="news3-header">

          </div>

      <div id="news3-body">

          </div>

      </div>

          <div id="news4">

          <div id="news4-header">

          </div>

      <div id="news4-body">

          </div>

      </div>

      </div>

      <p>{module_webapps,27951,a,,,,true,10,,1}</p>

       

      in the webapp presentation file, list-backup.html, I have put this script which should replace the innerhtml and output the text correctly

       

      <script>

              if ({tag_counter}==1){

                  document.getElementById('news1-header').innerHTML = '{tag_name}';

                  document.getElementById('news1-image').innerHTML = '{tag_image}';

                  document.getElementById('news1-body').innerHTML = '{tag_description}';

              }

              if ({tag_counter}==2){

                  document.getElementById('news2-header').innerHTML = '{tag_name}';   

              }

              if ({tag_counter}==3){

                 document.getElementById('news3-header').innerHTML = '{tag_name}';

                 

              }            

       

       

      </script>

       

      With this code, the page is blank, but when I delete the tag_description line, the output is ok!

      If I only have the tag_description in the list_backup file, it output ok!

       

      Any idea why this doesn't work?

       

      Thank you