We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9359
    • 128 Posts
    Hi everybody,
    i have a very urgent issue:
    i have a Ditto call with this filter:

    &filter=`tvazienda, 507, 1` ----> work great
    &filter=`tvazienda, id, 1` ----> Not work :-(
    &filter=`tvazienda, [+id+], 1` ----> Not work :-(
    &filter=`tvazienda, [*id*], 1` ----> Not work :-(

    If, out of ditto call, i write [*id*] in front end showed 507 (page id).
    How can i solve this problem?

    Modx evo version: 1.0.4 - ditto: 2.1.0
    thx



      "Destiny is not a matter of chance, it's a matter of choice"
      • 26016
      • 561 Posts
      Hi,
      Interesting question... I’m not sure, but how about trying this:

      &filter=`tvazienda, [~id~], 1`


      Cheers, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 9359
        • 128 Posts
        Thx for the reply.
        Unfortunately it’s not work.

        i’m desperate.

          "Destiny is not a matter of chance, it's a matter of choice"
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Is your Ditto call cached or uncached? Try it uncached with the [*id*] tags.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 9359
            • 128 Posts
            I tried to put the ditto call UnCacheable [! ... !] and also the page not suitable in cache....
            the [*id*] still not work.. embarrassed


            [!Ditto? &parents=`162` &showPublishedOnly=`1` &tpl=`UltimiProdotti` &orderBy=`createdon DESC` &depth=`0` &hideFolders=`1` &debug=`1` &filter=`tvazienda, [*id*] , 1` !]
              "Destiny is not a matter of chance, it's a matter of choice"
              • 16278
              • 928 Posts
              Try it without the spaces in the filter parameter.
              There must be no spaces in the "criteria" term unless you want them used in the comparison. (http://ditto.modxcms.com/tutorials/basic_filtering.html)

              And I think just the field name (id) should work, so it now reads:
              &filter=`tvazienda,id,1`

              smiley KP
                • 9359
                • 128 Posts
                thx KP.
                Is very very strange:

                Ditto Call:
                [!Ditto? &parents=`162` &depth=`0` &hideFolders=`1` &filter=`template,7,1|azienda,id,1` &debug=`1` &tpl=`UltimiProdotti` &showPublishedOnly=`1` &orderBy=`createdon DESC` !]

                The debug console has one Retreived data, but in the page still "No document found".
                see the Debug Console: http://www.prodotti-edilizia.com/ditto2.1.0_debug_doc507.html

                If i change my ditto call in this way:
                [!Ditto? &parents=`162` &depth=`0` &hideFolders=`1` &filter=`template,7,1|azienda,507,1` &debug=`1` &tpl=`UltimiProdotti` &showPublishedOnly=`1` &orderBy=`createdon DESC` !]

                The debug console is same, but in the page is showed the correct item.

                how can this happen? huh huh huh huh
                  "Destiny is not a matter of chance, it's a matter of choice"
                  • 16278
                  • 928 Posts
                  My error, I think - the filter should read azienda,[*id*],1 so that it compares the id of the document containing the Ditto call, not the id of the retrieved document. If you look at the retrieved document in the debug output, the id is 508, not 507.
                  embarrassed KP
                    • 9359
                    • 128 Posts
                    Yeahhhhhh!!!!!!
                    thx PK Now this ditto call work:
                    [!Ditto? &parents=`162` &depth=`0` &hideFolders=`1` &filter=`template,7,1|azienda,[*id*],1` &debug=`1` &tpl=`UltimiProdotti` &showPublishedOnly=`1` &orderBy=`createdon DESC` !]
                    Many many thx!!!!!!
                    enjoy!!
                      "Destiny is not a matter of chance, it's a matter of choice"