We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23050
    • 1,842 Posts
    Quote from: Mark at Feb 20, 2007, 12:36 PM

    ... laughs... I spent quite a large amount of time trying to do the exact opposite....

    Just for you I added &yearSortDir and &monthSortDir in Reflect so you can change the direction of the sort wink

    Oh ! Thank you Mark smiley
    I will update this tomorrow and tell you if all work. Big big thank wink

    About pub_date, I already have the last SVN version with the modif you made so I don’t know what’s happening after clearing the cache.
      • 32847
      • 171 Posts
      @Mark

      It’s OK, thank you
        • 8471
        • 333 Posts
        Quote from: Mark at Feb 20, 2007, 12:59 PM

        Part of the last commit:

        [FIXED] include issues (hopefully for good!)
        Thank you Mark! You have solved all problems smiley
          Sorry for my bad English grin
          • 18397
          • 3,250 Posts
          Appended to original post:


          The attached Ditto-trunk.tar.gz file is an updated SVN export from 2/20/06. Please use this instead of ditto2rc2.zip. The zip is still up there until people confirm that the php svn export script I’m using works.

          Please let me know if the new tarball works...
            • 23050
            • 1,842 Posts
            I’ve just reuploaded all Ditto folder from the SVN, and changed Reflect & Ditto snippets... all work for me !

            &yearSortDir and &monthSortDir are really useful ! Don’t forget to add them in your doc wink

            Thank you Mark smiley
              • 16732
              • 592 Posts
              Hi,
              I use something like that to call ditto in one of my snippets :

                //Ditto 2
                   $array_params['parents'] = '3';
                   $array_params['tpl'] = 'listingAnnuaire';
                   $array_params['extenders'] = 'request';
                   $array_params['tagData'] = 'tvlistCat,tvDepart';
                   $array_params['tagDelimiter='] = ',';
                   $array_params['hiddenTVs'] = 'listCat,Depart';
                   $array_params['displayArchive'] = '0';
                   //$array_params['emptyText'] = 'Aucune réponse';
                   $array_params['language'] = 'francais-utf8';
                  // $array_params['debug'] = '1';
                   $output .= $modx->runSnippet("Ditto2",$array_params);


              All is working with the ditto2rc2.zip version but I have no more result when I use the Ditto-trunk.tar.gz files

              debug info Ditto-trunk version:
              Ditto Version 2.0RC2
              Debug Info
              Number of documents supposed to summarized : 3
              Number of documents collected from the database: 0
              Sort by : createdon
              Sort direction: DESC
              Start at item 0 and stop at 3 out of 0
              Prefetch: Yes
              IDs
              None
              Snippet Parameters
              Parameters
              debug 	1
              displayArchive 	0
              extenders 	request
              hiddenTVs 	listCat,Depart
              parents 	3
              tagData 	tvlistCat,tvDepart
              tagDelimiter= 	,
              tpl 	listingAnnuaire
              
              Filter
              basic	
              source	   value    mode
              tvlistCat   1	      1
              tvDepart   Tout	    2
              	
              custom
              tagging
              delimiter	source	                 landing	mode	     format	givenTags	caseSensitive          tagFilter
              	          tvlistCat,tvDepart	 3	         onlyTags	html	    Array	        0
              	
              
              Fields
              display	   backend	 retrieved
              db	tv	custom
              published	id	pagetitle
              	
              adressePro	logoPro	sitePro	listCat	Depart
              	
              title
              	
              tv	db
              listCat	Depart
              	
              id	published
              	
              db	tv
              pagetitle	id
              	
              adressePro	logoPro	sitePro
              
              Document Data
              
              No documents found.
               


              EDIT : It’s working with basic filters not when I’m using &extenders=`request`
                • 24292
                • 28 Posts
                A couple of tiny problems.

                If &documents=`` then
                « MODx Parse Error »
                MODx encountered the following error while attempting to parse the requested resource:
                « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0' at line 3 »
                      SQL: SELECT DISTINCT sc.id FROM `cape`.`x_site_content` sc LEFT JOIN `cape`.`x_document_groups` dg on dg.document = sc.id WHERE (sc.id IN () AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0) GROUP BY sc.id ORDER BY sc.menuindex ASC 

                I’m trying to use it with a snippet call to return a list of documents which could be empty.

                Also, a template variable used in a phx condition doesn’t get filled in.
                [+image:isnot=``:then=`<a href="[~[+link+]~]"><img src="[+image+]" alt="[+title+]"</a>`+]

                has [+link+] empty but I can add <!--[link+]--> anywhere in the chunk and it will work.
                Since there is no longer a hiddenTVs parameter is it supposed to do this itself?
                  • 8471
                  • 333 Posts
                  Another problem... if I call ditto and there aren’t any documents to show, I receive this parse error:
                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource: 
                  « PHP Parse Error » 
                    
                  PHP error debug 
                    Error:  Invalid argument supplied for foreach()   
                    Error type/ Nr.:  Warning - 2   
                    File:  C:\sito\assets\snippets\ditto\classes\ditto.class.inc.php   
                    Line:  418   
                    Line 418 source:  foreach ($documents as $null=>$doc) {    
                    
                  Parser timing 
                    MySQL:  0.0517 s (9 Requests) 
                    PHP:  0.6738 s   
                    Total:  0.7255 s   
                  
                    Sorry for my bad English grin
                    • 18397
                    • 3,250 Posts
                    @laurentc: I’ll run a few tests based on the debug data and get back to you.

                    @Rachel: Try having both the PHx condition and the commented link in the template at the same time. This will let me know whether it is the PHx component failing or the TV detection routine.

                    @edipo: Will check
                      • 24292
                      • 28 Posts
                      Mark, if I have both PHx condition and comment then it works fine.

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