We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27843
    • 170 Posts
    to eol:
    I have installed Ditto 2.0.1 in MODx 0.9.6.1p2 and sortBy=`tvsometv,pagetitle` didn’ť work, now i’m upgrading all to MODx 0.9.6.3 so i’m corious if it will work
      • 5340
      • 1,624 Posts
      why don’t you do your own snippet with your custom sql querry
      It’s quite easy.

      $table = $modx->getFullTableName("site_content");
      $sql = "SELECT * FROM $table WHERE template = 6 AND isfolder = 1 AND deleted=0 AND published = 1 AND hidemenu = 0 ORDER BY pagetitle";
      $rs= $modx->db->query($sql); 
      
      while($doc = $modx->db->getRow($rs)){
      	//echo $doc['pagetitle'] . "<br />";
      	array_push($subjectsPT,$doc['pagetitle'] );
      }
      


      You just need to Join the site_content table with the modx_site_tmplvar_contentvalues table.

      If that is too complicated you ca do it in steps. Create an array with all the documents and arrange the array according to the TV

        • 30884
        • 142 Posts
        Ah, now there is a way to do this within ditto. don’t need to write anything major I suspect, let me have a quick look at how we did it (tis been a little while since I looked at this) and I’ll update this post.

        Cheers

        Jamie
          p i x e l p u s h e r e x t r o d i n a i r e
          A x i s A n i m a t i o n . c o m
          • 30884
          • 142 Posts
          &sortBy=`ArticleRating` &sortDir=`DESC` which is included into our ditto calls here. I would say that ArticleRating is a plain text TV with a number in there.

          Also I’m using Ditto 2.1, I don’t know if that’s the version your using as 2.01 or not, which ’resolved’ an earlier bug where sort on TV wasn’t really working (if i remember correctly, i could be wrong.)

          http://modxcms.com/Ditto-2.1-1878.html

          Cheers

          Jamie
            p i x e l p u s h e r e x t r o d i n a i r e
            A x i s A n i m a t i o n . c o m
            • 36416
            • 589 Posts
            Quote from: snop at Jan 07, 2009, 07:59 AM

            I have installed Ditto 2.0.1 in MODx 0.9.6.1p2 and sortBy=`tvsometv,pagetitle` didn’ť work, now i’m upgrading all to MODx 0.9.6.3 so i’m corious if it will work

            orderBy, not sortBy (Ditto 2.1+)
              • 27843
              • 170 Posts
              So Ditto 2.1 works as I except, it’s sorting output on the basis of the TV content. Great work wink
                • 30884
                • 142 Posts
                Quote from: Eol at Jan 08, 2009, 02:57 AM

                orderBy, not sortBy (Ditto 2.1+)

                Ah, I’m using an earlier build of 2.1 from the SVN I thinks, gotta update that soon.
                Glad it works for you!
                Cheers

                Jamie

                  p i x e l p u s h e r e x t r o d i n a i r e
                  A x i s A n i m a t i o n . c o m