We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37896
    • 11 Posts
    Hi,
    i'm trying to modify the string of a filename placeholder called in a chunk :
    the filter :replace doesn't seems to work...

    is it functionnal in Evo ? - i couldn't find the same doc that Revo's http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29#InputandOutputFilters%28OutputModifiers


    if not, what would be the way in Evo ?
    else, what is the correct syntax ?

    thanx by advance. [ed. note: spidflinch last edited this post 14 years, 10 months ago.]
      • 16278
      • 928 Posts
      The equivalent of filters in Evo is supplied by the PHx plugin. Some addons, notably Ditto, have their own copy of the PHx files, so you don't need to install PHx as a plugin if your chunk is a Ditto template. If you do install PHx in its own right, beware that it can have some awkward consequences concerning caching (e.g. using pagination in Ditto output).

      If you only need a little filtering here and there, it's probably better to write a suitable snippet to modify your placeholder output, and insert the snippet in your chunk. E.g.
      [[MyModifier?fname=`[+thatfile+]`]]

      The snippet:
      // MyModifier
      $output = str_replace('problem', 'challenge', $fname);
      return $output;
      


      :) KP
        • 37896
        • 11 Posts
        seems great ! i'll try that as soon as possible...
        thanx a lot.

        - the more i discover MODx, the more i love it ! wink
          • 37896
          • 11 Posts
          works perfectly !
          thanx again.