We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18219
    • 826 Posts
    Thank for a new version.

    But i have allway variable doesn’t display.
      Marc
      I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
      • 4195
      • 398 Posts
      is the plugin installed correctly? with the proper events?
        Armand Pondman
        MODx Coding Team
        :: Jot :: PHx
        • 18219
        • 826 Posts
        Yes, I followed the procedure:
        - To create the repertories
        - Unzip files
        - To create the plugin
        - Check the "OnWebPageInit" and "OnWebPagePrerender" event
        - To modify the plugin to take into account environment PHP5
        - etc.
          Marc
          I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
          • 32241
          • 1,495 Posts
          Nice one.
          Before I created chunkTpl library, I took this engine into consideration, but I’m having problem with the syntax. I just thought that it’s too complicated for me to understand it. So I decided to create a simple library that I called chunkTpl. But after you take initiative in integrating this, I might as well learn this templating engine again wink
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 4195
            • 398 Posts
            it was a bit confusing for me also but with some basic understanding of logic and the tbs manual you can come a long way wink
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx
              • 18219
              • 826 Posts
              I still do not understand why the variables are not display. I followed the configuration huh

              I withdrew # of line 57 of the file tbs4modx.class.inc.php
              echo 'merge for ['. $tplvar.'] : '.$n.'='.$v2.'<br />';
              


              No message with the screen: to believe that the class is not implemented.
              Do you have an idea?

              For information, here the code which I placed in a snippet:
              // Test TBS
              global $modx;
              global $mysnippet_template;
              global $myvariable; 
              $mysnippet_template='
              <h3>[{myvariable}]</h3>
              ';
              $myvariable='hello';
              
              $template = $modx->tbsTpl->addTemplate($mysnippet_template);
              $modx->tbsTpl->addField($template,'myvariable',$myvariable);
              $modx->tbsTpl->addBlock($template,'myarray',$myarray); 
              $output = $template;
              

              I tested [{myvariable}], [{var.myvariable}], [myvariable] and [var.myvariable] with the same result: no display

              Thanks
                Marc
                I&#39;m French... Sorry for my bad English, I use &#39; Google Translator&#39; or other... but that remains that tools wink
                • 4195
                • 398 Posts
                it’s not working here also I don’t know why.. but the workaround is to use an array for the variables like i showed a couple posts earlier.
                  Armand Pondman
                  MODx Coding Team
                  :: Jot :: PHx
                  • 18219
                  • 826 Posts
                  Ok Bs, I applied the method which you gave higher and that functions wink
                  You cannot think that your solution leaves me a delicate situation laugh laugh

                  Thanks
                    Marc
                    I&#39;m French... Sorry for my bad English, I use &#39; Google Translator&#39; or other... but that remains that tools wink
                    • 4195
                    • 398 Posts
                    I did some some tests.. the behaviour comes from within TBS.. it has something to do with the delimiters.

                    If i use 1 character in the start and end delim: ea. {variable} it works fine.
                    but if you use 2 characters in the start and end delim: ea. [{variable}] it won’t parse the simple variables .. very strange wink

                    solution would be to switch to 1char delimiters (so we don’t have to touch the TBS code smiley
                      Armand Pondman
                      MODx Coding Team
                      :: Jot :: PHx
                      • 4195
                      • 398 Posts
                      to solve the notices/errors in the log add:

                      Find:
                      $modx->tbsTpl = new TBSModx('[{,}]','xxx_');
                      


                      and below it add:
                      $modx->tbsTpl ->NoErr = true
                      
                        Armand Pondman
                        MODx Coding Team
                        :: Jot :: PHx