We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8471
    • 333 Posts
    I have the same problem of xeres:
    With two calls of ditto (that use the date extender) I can see the date only in one call.
      Sorry for my bad English grin
      • 32847
      • 171 Posts
      @Mark
      As you can see, I call pub_date in config but Ditto understand createdon.

      Ditto Version 2.0RC1
      Debug Info
      Number of documents supposed to summarized : 20
      Number of documents collected from the database: 40
      Sort by : createdon
      Sort direction: DESC
      Start at item 0 and stop at 20 out of 40
      Prefetch: Yes
      IDs
      398, 400, 404, 405, 406, 410, 412, 413, 415, 416, 419, 420, 421, 422, 423,
      424, 425, 426, 427, 428
      Snippet Parameters
      Parameters
      alwaysshow 	1
      dateFormat 	%d.%m
      dateSource 	pub_date
      debug 	1
      depth 	4
      extenders 	date,tagging
      id 	2
      paginate 	1
      parents 	13,2,3,4,16,69
      sortBy 	pub_date
      summarize 	20
      tagData 	tvTags
      tagDelimiter 	,
      tagMode 	onlyTags
      tags 	Vie des lyceesFamilles,Projets,Relations internationales,CDI,Sports,Personnels,Radio
      tpl 	NewsVie
      
      Filter
      custom
      tagging
      delimiter	source	landing	mode	format	givenTags
      ,	tvTags	13	onlyTags	html	Vie des lyceesFamilles,Projets,Relations internationales,CDI,Sports,Personnels,Radio
      	tagFilter
      
      Fields
      display	backend	retrieved
      db	tv	unknown
      id	description	published	pagetitle
      	
      Tags
      	
      date
      	
      tv	db
      Tags
      	
      id	published	createdon
      	
      db
      description	pagetitle	id
        • 18397
        • 3,250 Posts
        @edipo & xeres: Try the latest SVN HEAD. I just made more commits that should fix both issues.
          • 32847
          • 171 Posts
          It’s ok for pub-date wink and with one call

          But with two call, big problem tongue

          Fatal error: Cannot redeclare class prePHx in www\modx\assets\snippets\ditto\classes\phx.pre.class.inc.php on line 11


          Each Ditto call works great alone but not both together
            • 18397
            • 3,250 Posts
            Ok, check the SVN again.
              • 32847
              • 171 Posts
              Hello Mark,
              I check the SVN, it seems to be the same problem with other function
              Fatal error: Cannot redeclare dateph() (previously declared in www\modx\assets\snippets\ditto\extenders\date.extender.inc.php:16) in www\modx\assets\snippets\ditto\extenders\date.extender.inc.php on line 26

              May be same solution wink
              I just call Date extender two times but I suppose there would be the same bug with other extender (tagging...)
                • 23050
                • 1,842 Posts
                Hi there,

                I’ve updated from the last Reflect and one thing doesn’t work anymore.

                See solution at the end of this post.

                Here is the document tree

                TopNews (id=23)
                - News 1
                - News 2
                - News 3

                I use Reflect to build a nav based on archives both on TopNews (where I list 5 last articles) and on each document (News 1 2 3)

                Here is the code I used :
                [[Ditto &startID=`23` &summarize=`0`]]
                [[Reflect?]]


                This code worked well before I upgrade.
                Now, it only shows up archives on TopNews (parent folder) but not on each child document. Here is the error it outputs :

                PHP error debug
                  Error: 	Invalid argument supplied for foreach()	 
                  Error type/ Nr.: 	Warning - 2	 
                  File: 	/home/histfr/www/modx096/assets/snippets/ditto/classes/ditto.class.inc.php	 
                  Line: 	412	 
                  Line 412 source: 	foreach ($documents as $null=>$doc) {


                I think I should call a new parameter of whatever else but don’t know where. I tried both cache and uncached call, I tried with unique id in both Ditto and Reflect call... Nothing works.

                Any idea ?

                Thank you smiley



                Edit: Ok, Heliotrope gave me the solution. Here is the code :

                [!Reflect? &dittoSnippetParameters=`parents:23|summarize:all` &dittoSnippetName=`Ditto`!] 


                In fact, with the new Reflect, you don’t need anymore to call Ditto before Reflect. Thanks to &dittoSnippetParameters, you just call Reflect and choose the parameters you would have chosen for your Ditto call. Magic !!!

                Thank you Mark for this functionnality (and thx Helio for explain me that wink )
                  • 23050
                  • 1,842 Posts
                  New question, new post.
                  Here is the Reflect call :

                  [!Reflect? &dittoSnippetParameters=`parents:23|summarize:all|dateSource:pub_date|extenders:date|sortDir:ASC|sortBy:pub_date` &dittoSnippetName=`Ditto` &groupByYears=`0` &dateSource=`pub_date`!] 


                  If I clear the cache, the first time I display a page with Reflect, I get the first screen (apres-vide-cache.jpg).
                  If I push F5, I get the second screen (apres-f5.jpg).

                  Normal to get this ?


                  Other question : I would like to display archives with the most recent month at the top. I have dateSource:pub_date|extenders:date|sortDir:ASC in Reflect Call but it only changes the order above each month and not for all months. Am I clear ? January is always the first month of the list.
                  In the same time, ASc or DESC work well inside each month, docs are well listed.
                    • 18397
                    • 3,250 Posts
                    @perrine: I see you are sorting by pub_date... make sure you are using the latest SVN HEAD as it fixed an issue with this.

                    As for "I would like to display archives with the most recent month at the top. "

                    ... 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

                    Also, you don’t need to have &dittoSnippetName in your Reflect call. The snippet name defaults to Ditto already.
                      • 18397
                      • 3,250 Posts
                      Part of the last commit:

                      [FIXED] include issues (hopefully for good!)

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