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

    I’m trying to get some news teasers out of documents that are stored themselfs in subfolders ( one folder for each client - for grouping purposes), the Ditto call therefore is 2 levels up the docs I need. The subfolders should not appear in the ditto listing, only their child documents (grand childs to the doc with the Ditto call).

    I tried this with &where=`isfolder,0,2` in the Ditto call should read WHERE the document’s "isfolder" property equals to 0. So I hoped to eliminate the grouping subfolders and get the docs in the subfolders. But I’m getting MODx parse errors (... operand should contain 1 column(s)), and I’m not sure if the &where foramting is correct. Also tried &where=`isfolder==0`, and &filter=`isfolder,0,2`

    Any hint for that? Or maybe a better solution?
    Thanks a lot! huh
      • 25830
      • 19 Posts
      Try &filter=`isfolder,0,1`?

      Also, as far as I know the &where clause of Ditto is the same as the MYSQL where clause, so in your case it would be &where=`isfolder=0`
        • 4310
        • 2,310 Posts
        &where=`isfolder=0`
        That’s what I thought but after a quick try it causes a parse error, at
        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « Execution of a query to the database failed - Unknown column 'sc.isfolde' in 'where clause' »
              SQL: SELECT DISTINCT sc.id,sc.published FROM `web38-sandbox`.`modx_site_content` sc LEFT JOIN `web38-sandbox`.`modx_document_groups` dg on dg.document = sc.id WHERE (sc.id IN (3,42,43,47) AND sc.published=1 AND sc.deleted=0 AND sc.isfolde) AND (sc.privateweb=0) GROUP BY sc.id ORDER BY sc.createdon DESC 
        so it seems to be choking on the equals sign.
          • 36592
          • 970 Posts
          Why don’t you make &parents parameter to specify those category folders like ... &parents=`2,4,8` ?
          (where 2,4,8(just an example) are document ids of category folder documents.)
            • 12110
            • 122 Posts
            I thought of the option to use &parents, but I want the client not to have to change Ditto Parameters when adding a new client=subfolder + news for this client.

            And I like to knwo more about the &where clause and mysql queries in MODx smiley

            Thanks again if somebody has an idea or solution.
              • 25830
              • 19 Posts
              Have you tried &filter=`isfolder,0,1` yet?
                • 12110
                • 122 Posts
                Hello ryanlwh,

                I tried now &filter=`isfolder,0,1`and this seems to work, thanks!

                I’m going on with &filter instead of &where ...
                  • 8565
                  • 3 Posts
                  Hi all! I’ve just faced with this problem and find the solution. The reason because where=`<condition>=<option>` doesn’t work in parser. Last letter in <condition> are removed. Add any one sybmol (example _ ) and problem solved! smiley