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

    i have a problem with nested filters. the code is the following:

    [[*img.show:notempty=`
    <div id="main">
    	<div id="left" class="show[[*img.show]]"[[$img.Left:notempty=`style="background-image: url([[++base_url]][[$img.Left]])"`]]>
    		[[*headline.position:is=`left`:then=`123`:else=` `]]
    	</div>
    	[[*img.Center:notempty=`
    	<div id="center" class="show[[*img.show]]" style="background-image: url([[++base_url]][[*img.Center]])">
    		[[*headline.position:is=`center`:then=`123`:else=` `]]
    	</div>
    	`]]
    	[[*img.Right:notempty=`
    	<div id="right" class="show[[*img.show]]" style="background-image: url([[++base_url]][[*img.Right]])">
    		[[*headline.position:is=`right`:then=`123`:else=` `]]
    	</div>
    	`]]
    	<div class="clear"></div>
    </div>
    `]]
    


    if img.show is empty, then instead an empty string the rendered output looks like this:

     `]]
    	</div>
    	`]]
    	<div class="clear"></div>
    </div>
    


    well, i figured out that when i remove

    [[*headline.position:is=`right`:then=`123`:else=` `]]
    


    from the nested "notempty" (img.Center & img.Right) filter then the code is rendered properly.

    so what is wrong with the "is" filter?

    i am on the way to bypass the problem with my own snippet filter. but i am interested what i made wrong?

    thx & regards
    from germany

    Edit: I am using MODX Revolution 2.2.6-pl (traditional)
      • 22303 MODX Staff
      • 10,725 Posts
      Unfortunately, the regex necessary to support the filter functionality implemented in MODX Revolution, and based on the phX extension from Evolution, breaks when they are nested and a solution to support all scenarios of nested filters has yet to be realized. That said, I recommend avoiding nested output filters, especially conditionals, as discussed in my blog post from late last year --> http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
        • 38136
        • 42 Posts
        thanks for the quick reply.

        is there a roadmap in which version this will be solved?

        greetings
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: mopox at Jan 15, 2013, 10:41 AM
          is there a roadmap in which version this will be solved?
          Unfortunately, I exhausted many hours trying to find a solution, but I can't predict when or even how it will be solved.
            • 38136
            • 42 Posts
            well, ur blog post was quite helpfull to bypass the problem for me.

            though, it 'ld be nice when nesting is available.

            but i think also the perfomance need to be considered in that way.

            thx,
            so far