We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi Guys,
    I need to be able to use backspace for chunk output so that I can remove the last character of the chunks output. (Chunk is based of conditionals and tv image file paths)

    say i have a chunk called test and i call it using
    [[$test]]
    and it displays say "hello world". I need syntax along the lines of
     [[$test? &backspace=`1`]]
    so that "hello worl" (without the d) is outputted.

    I need to get an image slider working

    Any ideas please?
    Thanks
    Revo 2 [ed. note: howster last edited this post 15 years ago.]
      • 3749
      • 24,544 Posts

      [[$test:RemoveLastChar]]


      <?php
      /* RemoveLastChar snippet */
      return substr($input, 0, -1);
      
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting