We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6348
    • 90 Posts
    [[Ditto? &tpl = ` production_row ` &startID = ` 3 ` &filter = ` tv_comnati, studio, 1|tv_comnati, chateaux, 1 ` &noResults = ` No pos!`]]

    Why, if in the filter of 1 parametre (studio or chateaux) finds and if you want or-or is not present?

    tv_comnati - TV parameters
      • 16278
      • 928 Posts
      Try it without the spaces in the filter string
      &filter = `tv_comnati,studio,1|tv_comnati,chateaux,1`

      smiley KP
        • 3749
        • 24,544 Posts
        And while you’re at it, take out the spaces around the = signs. wink
          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
          • 6348
          • 90 Posts
          [[Ditto? &tpl=`production_row`&startID=`3`&filter=`tv_comnati,studio,1|tv_comnati,chateaux,1`&noResults=`No pos`]]

          All the same does not find chateaux and studio
            • 16278
            • 928 Posts
            Looking more closely at your filter, that’s correct. Not a bug, because your filter excludes documents that do not contain "studio" or do not contain "chateaux" in the specified field . A document with both will have "studio||chateaux" as the value of the field, so it is excluded.

            You’ll more likely get the result you need using
            &filter=`tv_comnati,studio,7|tv_comnati,chateaux,7`
            where you are excluding documents that don’t contain the values, rather than don’t equal them.
            rolleyes KP
            See tutorial on official Ditto site and updated list of modes on Pogwatch
              • 6348
              • 90 Posts
              I do not understand, logicians are not present any:
              [[Ditto?&tpl=`production_row`&startID=`3`&filter=`tv_comnati,studio,7`&noResults=`no_res`]]

              On the screen result:
              studio | 120$

              [[Ditto?&tpl=`production_row`&startID=`3`&filter=`tv_comnati,chateaux,7`&noResults=`no_res`]]

              On the screen result:
              chateaux | 240$
              chateaux | 330$

              It is necessary for me that was studio and chateaux
              I write:
              [[Ditto?&tpl=`production_row`&startID=`3`&filter=`tv_comnati,studio,7|tv_comnati,chateaux,7`&noResults=`no_res`]]

              But on the screen anything is not present.
              TV parametres: chateaux, studio, home
                • 16278
                • 928 Posts
                Hmmm... not sure what’s going on there then huh Could you post what your tpl chunk looks like? If the "|" (pipe character) is part of your data, it could be a problem. What does the output of tv_comnati look like if you include it as [+tv_comnati+] in the tpl without any filtering?

                You might also be better off using tagging instead of filters to select your items:
                - in the tv_comnati TV, add the Delimited List widget, with a comma (the default) as the separator
                - name the tag field, the tags and the delimiter in your Ditto call:
                [[Ditto?&tpl=`production_row` &startID=`3` &tagData=`tv_comnati` &tags=`studio,chateaux` &tagDelimiter=`,` ]] 
                It’s more positive and a little less headache-inducing that the negative logic of the filter mechanism.

                See http://ditto.modxcms.com/files/assets/snippets/ditto/extenders/tagging-extender-inc-php.html for more on tagging extender.
                smiley KP
                  • 6348
                  • 90 Posts
                  Here so it should be deduced

                  <tr class="result_svet">
                  <td class="stolbec1"><a href="[~[+id+]~]">[+title+]</a></td>
                  <td class="stolbec2">[+tv_comnati+]</td>
                  <td class="stolbec3">[+tv_placement_city+]</td>
                  <td class="stolbec4">[+tv_price+]</td>
                  </tr>

                  [[Ditto?&tpl=`production_row` &startID=`3` &tagData=`tv_comnati` &tags=`studio,chateaux` &tagDelimiter=`,` ]]

                  There was an error:
                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource:
                  « PHP Parse Error »

                  PHP error debug
                  Error: htmlspecialchars() expects parameter 1 to be string, array given
                  Error type/ Nr.: Warning - 2
                  File: /home/exclusive-real-estate.ru/public_html/assets/snippets/ditto/classes/ditto.class.inc.php
                  Line: 1030
                  Line 1030 source: $query[htmlspecialchars($param, ENT_QUOTES)] = htmlspecialchars($value, ENT_QUOTES);

                  Parser timing
                  MySQL: 0.0043 s (7 Requests)
                  PHP: 0.0610 s
                  Total: 0.0653 s