Forum Discussion

JoeTheFifth's avatar
JoeTheFifth
Icon for Altostratus rankAltostratus
Sep 27, 2019

APM DecisionBox Customization

I'm trying to add some text with multilanguage support on a decision box.

I used the option1/option2 boxes but I'd like to have additional text outside of these fields.

Any idea how to add an additional field?

I tried modifiying the .inc file but no luck so far.

1 Reply

  • I ended up using javascript like this inside the decision_box.inc file

     

    <p id="customtitleplaceholder"></p>

    <p id="customtextplaceholder"></p>

     

    <script type="text/javascript">

    var userLang = navigator.language || navigator.userLanguage; 

    switch(userLang.toLocaleLowerCase()) {

     case 'en-us':   

      var customtitle = 'en blablabla text';

      var customtext= 'fr blablablabla';   

      break;

     case 'en-fr':   

      var customtitle = 'fr blablabla text';

      var customtext= 'fr blablablabla';  

      break;

     default:   

      var customtitle = 'en blablabla text';

      var customtext = 'en blablablabla'; 

    }

    document.getElementById('customtitleplaceholder').innerHTML = customtitle

    document.getElementById('customtextplaceholder').innerHTML = customtext

    </script>

     

    if you have a better way then please you're welcome to comment.