We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7131
    • 83 Posts
    Is the language file named francais.language.php?

    Yes. No, indeed, the file, as Susan states below, is called francais.inc.php. If I set the default language to francais into the snippet, i.e. $language = (isset($language))? $language : "francais";, french is returned, even when I call &language=`english`.

    As for sortBy, even though I change the default value to menuindex, ditto still sorts the documents by createdon.
      at the edge of dawn,
      you ask yourself if your shadow did follow you down
      all night long
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Is the language file named francais.language.php?
      Shouldn’t it be named "francais.inc.php"? At least, the default file in the lang folder is "english.inc.php".
        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
        • 18397
        • 3,250 Posts
        My mistake... I was in a rush. Upon further inspection I believe you are encountering the same error that was causing issues with multiple calls. Search the first posts in this thread for the simple patch. I will put out 1.0.1 tomorrow with all the patches from this thread as well as a major new feature (tagging) if you would rather wait.
          • 7131
          • 83 Posts
          Hum... embarrassed I’m an idiot... I simply called the snippet with "langage" (like it’s written in French) instead of "language". I still have the sortBy problem though.
            at the edge of dawn,
            you ask yourself if your shadow did follow you down
            all night long
            • 18397
            • 3,250 Posts
            Could you run the snippet with &debug=`1` and post the results here? Thanks.
              • 7131
              • 83 Posts
              Here it is!

              Number supposed to be summarized (summarize): 4
              
              Total supposed to be returned: 4
              Count of total in db: 4
              Sort by (sortBy): menuindex
              Sort direction (sortDir): DESC
              Using the API Method (allows for everything except pub_date, unpub_date, editedon, deletedon, and multilevel)
              Start at 0 and stop at 4 out of 4
              
              Document Data for "Electric mobility"
              id = 24
              type = document
              contentType = text/html
              pagetitle = Electric mobility
              longtitle = What is electric mobility?
              description =
              alias = electric-mobility
              published = 1
              pub_date = 0
              unpub_date = 0
              parent = 15
              isfolder = 0
              introtext =
              richtext = 1
              template = 4
              menuindex = 4
              searchable = 1
              cacheable = 1
              createdby = 1
              createdon = 1129049909
              editedby = 1
              editedon = 1148620017
              deleted = 0
              deletedon = 0
              deletedby = 0
              publishedon = 1129049909
              publishedby = 1
              menutitle = Electric mobility
              donthit = 0
              haskeywords = 0
              hasmetatags = 0
              privateweb = 0
              privatemgr = 0
              content_dispo = 0
              hidemenu = 0
              currentTPL = firstRow
              
              Document Data for "Our goals"
              id = 14
              type = document
              contentType = text/html
              pagetitle = Our goals
              longtitle = Our goals
              description =
              alias = goals
              published = 1
              pub_date = 0
              unpub_date = 0
              parent = 15
              isfolder = 0
              introtext =
              richtext = 1
              template = 4
              menuindex = 3
              searchable = 1
              cacheable = 1
              createdby = 1
              createdon = 1127939508
              editedby = 1
              editedon = 1148620142
              deleted = 0
              deletedon = 0
              deletedby = 0
              publishedon = 1127939508
              publishedby = 1
              menutitle = Our goals
              donthit = 0
              haskeywords = 0
              hasmetatags = 0
              privateweb = 0
              privatemgr = 0
              content_dispo = 0
              hidemenu = 0
              currentTPL = altRows
              
              Document Data for "Our vision"
              id = 22
              type = document
              contentType = text/html
              pagetitle = Our vision
              longtitle = Our vision
              description =
              alias = vision
              published = 1
              pub_date = 0
              unpub_date = 0
              parent = 15
              isfolder = 0
              introtext =
              richtext = 1
              template = 4
              menuindex = 2
              searchable = 1
              cacheable = 1
              createdby = 1
              createdon = 1128954065
              editedby = 1
              editedon = 1148609000
              deleted = 0
              deletedon = 0
              deletedby = 0
              publishedon = 1128954065
              publishedby = 1
              menutitle = Vision
              donthit = 0
              haskeywords = 0
              hasmetatags = 0
              privateweb = 0
              privatemgr = 0
              content_dispo = 0
              hidemenu = 0
              currentTPL = TPL
              
              Document Data for "Our mission"
              id = 16
              type = document
              contentType = text/html
              pagetitle = Our mission
              longtitle = Our mission
              description =
              alias = mission
              published = 1
              pub_date = 0
              unpub_date = 0
              parent = 15
              isfolder = 0
              introtext =
              richtext = 1
              template = 4
              menuindex = 1
              searchable = 1
              cacheable = 1
              createdby = 1
              createdon = 1128012596
              editedby = 1
              editedon = 1148608735
              deleted = 0
              deletedon = 0
              deletedby = 0
              publishedon = 1128012596
              publishedby = 1
              menutitle = Mission
              donthit = 0
              haskeywords = 0
              hasmetatags = 0
              privateweb = 0
              privatemgr = 0
              content_dispo = 0
              hidemenu = 0
              currentTPL = altRows
                at the edge of dawn,
                you ask yourself if your shadow did follow you down
                all night long
                • 18397
                • 3,250 Posts
                According to that, it is sorting correctly. Just remember it defaults to DESC order so it is going 4 3 2 1. Do sortDir=`ASC` to fix that.
                  • 7131
                  • 83 Posts
                  Thanks, everything is perfect! At least, Ditto is... wink
                    at the edge of dawn,
                    you ask yourself if your shadow did follow you down
                    all night long
                    • 27055
                    • 3 Posts
                    Thanks for this great snippet Mark. Tagging feature in next release sounds very attractive to me.

                    Btw, there’s one little bug here.
                    in the snippet code, between line 102 to 112,

                    $hiddenTVs = (isset($hiddenTVs))? $hiddenTVs : "" ;
                    	// allows the snippet to filter by tv's not in the template. separate by comma.
                    	
                    $sortDir = isset($sortDir) ? strtoupper($sortDir) : 'DESC';
                        // get sort dir
                    	
                    $sortBy = isset($sortBy) ? $ditto->checkSort($sortBy, $dateFormatType, $hiddenTVs, $mode) : "createdon";
                        // get sortBy	
                    
                    $hiddenTVs = $ditto->hiddenTVs;
                    	// grab latest hiddenTV additions 
                    


                    When $sortBy is not set, it empties $hiddenTVs value.

                    $hiddenTVs = $ditto->hiddenTVs;

                    this should be done only when checkSort() was called.
                      • 18397
                      • 3,250 Posts
                      Ah, thanks for catching that. Can you file a bug report. Thanks!

                      This discussion is closed to further replies. Keep calm and carry on.