We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14951
    • 151 Posts
    Okay...I'm going to feel silly I'm sure once I get an answer, but this code works perfectly fine outside of MODx... What might be the problem with this as an output filter?

    <?php
    if (($input % 3) == 0){return $options;}


    Ultimately I'm trying to have it return some code (passed in the options) every third item and am using it like this:
    [[ +idx:modulus=`<p>Yay</p>` ]] // Spacing Added to for forum display


    The IDX is properly returning the numbers, but my output filter doesn't seem to care.

    When I run this outside of MODx and manually set the value of $input, this script works perfectly... for some reason... it's not working as an output filter though.

    Any ideas as to why?

    Thanks in advance for making me feel like a goofball...

    -Jared
      • 4172
      • 5,888 Posts
      there is allready an outputfilter with name 'modulus', so try, if renaming your custom-outputfilter helps
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 14951
        • 151 Posts
        Sure enough...I feel like a goofball! I knew it had to be something stupid I was missing!

        Thank you so much!
        -Jared