We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28432
    • 372 Posts
    Hi,

    I try to make my own modifier but i don't know why it doesn't work.
    I'm working on a MODX Revolution 2.5.0-pl (advanced)

    Modifier apply on content :
    [[*content:myModifier]]


    My modifier :
    $output = 'NOTHING';
    return $output;


    No result, i get the content from the ressource without doing anything.

    By the past i made some modifier like this :
    $search = array(‘À’,‘Á’,‘Â’,‘Ã’,‘Ä’,‘Å’,‘Ç’,‘È’,‘É’,‘Ê’,‘Ë’,‘Ì’,‘Í’,‘Î’,‘Ï’,‘Ò’,‘Ó’,‘Ô’,‘Õ’,‘Ö’,‘Ù’,‘Ú’,‘Û’,‘Ü’,‘Ý’,‘à’,‘á’,‘â’,‘ã’,‘ä’,‘å’,‘ç’,‘è’,‘é’,‘ê’,‘ë’,‘ì’,‘í’,‘î’,‘ï’,‘ð’,‘ò’,‘ó’,‘ô’,‘õ’,‘ö’,‘ù’,‘ú’,‘û’,‘ü’,‘ý’,‘ÿ’);
    $replace = array(‘A’,‘A’,‘A’,‘A’,‘A’,‘A’,‘C’,‘E’,‘E’,‘E’,‘E’,‘I’,‘I’,‘I’,‘I’,‘O’,‘O’,‘O’,‘O’,‘O’,‘U’,‘U’,‘U’,‘U’,‘Y’,‘a’,‘a’,‘a’,‘a’,‘a’,‘a’,‘c’,‘e’,‘e’,‘e’,‘e’,‘i’,‘i’,‘i’,‘i’,‘o’,‘o’,‘o’,‘o’,‘o’,‘o’,‘u’,‘u’,‘u’,‘u’,‘y’,‘y’);
    $output = str_replace($search, $replace, $input);
    return $output;

    I try to apply that one and it don't work too.

    What am i doing wrong ?

    This question has been answered by Steeve. See the first response.

      • 3749
      • 24,544 Posts
      Try this:

      $x = $input;
      $x = 'NOTHING';
      return $x;
      


      also, double-check the spelling of the modifier name.



        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
        • 28432
        • 372 Posts
        I try your code and i've check the name but still it doesn't work. Very strange !
          • 3749
          • 24,544 Posts
          You're right, it's odd. Your modifier is a snippet, right?

          I can't think of anything else other than a syntax error in the snippet code.
            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
            • 28432
            • 372 Posts
            Yes it's a snippet !
            I've try a lot of different code before and after asking in the forum. I try to change snippet, content call, on different call like longtitle, pagetitle...

            Very very strange. I'll try to update MODX himself tomorrow.
            • discuss.answer
              • 28432
              • 372 Posts
              I've update MODX Revolution 2.5.0-pl (advanced) to MODX Revolution 2.5.1-pl (advanced) and now it work...
              Very very very STRANGE ^^