We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    I’m working on a real estate site and basically trying to create House and Land packages by listing each block of land available and calculating a price based on the lowest priced house that will fit on that block. Any homes that are wider than the block are filtered out, as are any that are longer.

    The following is nested inside another Ditto List template (list of available blocks of land), and the Ditto call contained below outputs the price in a single placeholder inside ’tplHousePrice’:

    [+lndPrice:math=`?+[[Ditto?&parents=`7`&display=`1`&depth=`5`&orderBy=`ptyPrice ASC`&tpl=`tplHousePrice`&filter=`ptyLength,[+lndDepth+],4|ptyWidth,[+lndFrontage+],4`]]`+]


    When I only use one filter, all is ok. But when I have two separated by the pipe as shown above, I get this error:

    Parse error: syntax error, unexpected T_IS_NOT_EQUAL in mywebsitefolder/assets/plugins/phx/phx.parser.class.inc.php(280) : eval()'d code on line 1


    Interestingly, Ditto still returns the correct results below the error message. It worked fine on my laptop during development, but I get this error on the live server. Crap!

    I appreciate that this is far from the ideal way to do this, but I’m no programmer and writing a custom snippet is beyond my capability. However it does what I need it to do.
    Any ideas about how to get the filters working?
      • 33968
      • 863 Posts
      Ok. Investigating further I think the error is generated when there are ’no results’ returned, as this enters the ’no results’ text into the phx:math equation.

      But setting &noResults=`0` does not work, ditto only accepts text in this field. I’ve edited the Lang file and changed the default text ’No documents found’ to ’0’.
      That serves my purpose and my filter/hacks work now.

      BUT

      If anyone can suggest a better way of doing that filter, please can you let me know - if not a solution but a suggestion on how to go about it?
      I’ve cached the Ditto calls but it all seems horribly inefficient for what I am trying to do!!