We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44588
    • 8 Posts
    Please help! Chaining output filters doesn't work in chunks. Single filters works fine, but if multiple filters applies to placeholder, then the whole material output becomes broken. Because of this I can't use some important modules like Login, because it relies on "is" filter to process messages when profile is edited. And "is" for itself must be used with other filters like "then" and "else", so the whole construction becomes chain of filters.
    For example:

    This filter works fine:
    [[+bigsrc:notempty=`<a href="[[+bigsrc:empty=`[[+src]]`]]" style="display:block" data-lightbox="page images" title="[[+title]]">`]]
    but this one already won't work:
    [[+bigsrc:notempty=`<a href="[[+bigsrc:empty=`[[+src]]`]]" style="display:block" data-lightbox="page images" title="[[+title]]">`:empty=``]]

    I've read that this issues already was in versions 2.1.x more than a year ago, wasn't it fixed, or is there some work around?
      • 3749
      • 24,544 Posts
      Your code doesn't make any sense to me (maybe I'm just tired). It appears that you're testing for bigsrc being empty inside a test for it being notempty. That second test will never be passed. Then, you're testing the results of the notempty modifier to see if they're empty.

      I'm guessing, but you might want something like this:

      [[+bigsrc:notempty=`<a href="[[+bigsrc]]" style="display:block" data-lightbox="page images" title="[[+title]]">`:else=[[+src:notempty=`<a href="[[+src]]" style="display:block" data-lightbox="page images" title="[[+title]]">`:else=``]]]]


      That's fairly deep nesting. I'm not sure it will work, and if it does, it will be slow. It would be a lot faster to do it with a custom snippet.

        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
        • 44588
        • 8 Posts
        Um... well OK... Actually It's not my code that's wrong. I believe so at least. And it's actually doesn't matter what it does. Because it's not just do something that I don't want, It just break all the output of the whole document. Your example also doesn't work for me as well as mine. For another example I'll take the code from official manual for Login module that's won't work:
        this string will give me just `]] instead of the whole document:
        [[+login.update_success:if=`[[+login.update_success]]`:is=`1`:then=`[[%login.profile_updated? &namespace=`login` &topic=`updateprofile`]]`]]
        It's taken 'as is' from example on this page: http://rtfm.modx.com/display/ADDON/Login.UpdateProfile
        But, if this string removed, everything else starts to work. But as you can see, there is no more nested or chained filters in example on the page. [ed. note: demnus last edited this post 13 years, 2 months ago.]