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
    Sorry Spoof, I was speaking about another problem when Ditto doesn’t have anything to output. It would be nice if Reflect wouldn’t output "Bad Ditto Object" is that case.

    About your problem... I can’t correct it, sorry... Except maybe that Reflect must be called just after Ditto ?
    Does Ditto output something ? without reflect ?
      • 11975
      • 2,542 Posts
      Spoof did you try to add the id param both ditto and reflect

      [[Reflect? &dateSource=`pub_date` &dateFormat=`%Y` &id=`bignews` ]]

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 19645
        • 23 Posts
        Hi,

        I have had a small problem with the json output from Ditto 1.1 for use with Dittocal, because of a missing comma in json.format.inc.php:
        $json_tpl = <<<TPL
        	{
        	 "title":"[+json_pagetitle+]",
        	 "link":"[(site_url)][~[+id+]~]" <--here
        	 "date":"[+json_date+]",
        	 "guid":"[(site_url)][~[+id+]~]",
        	 "author":"[+json_author+]",
        	 "description":"[+json_description+]",
        	 "summary":"[+json_summary+]",
        	},
        
        TPL;
        
        $json_tpl_last = <<<TPL
        	{
        	 "title":"[+json_pagetitle+]",
        	 "link":"[(site_url)][~[+id+]~]" <---here
        	 "date":"[+json_date+]",
        	 "guid":"[(site_url)][~[+id+]~]",
        	 "author":"[+json_author+]",
        	 "description":"[+json_description+]",
        	 "summary":"[+json_summary+]",
        	}
        TPL;
        

        Added a comma after the "link":"[(site_url)][~[+id+]~]" parts.
          • 18397
          • 3,250 Posts
          Thank you, fixed for the next version.
            • 33114
            • 518 Posts
            Dunno if I can filter using recursive call, but
            &filter=`id,[*id*],2`
            

            doesnt work (though, `id,292,2` does).

            The idea was to display "Other news" section right after some news article - those other news shouldnt contain current news article.
              http://modx.ru - российская поддержка MODx
              http://newscup.ru - экспериментальный проект
              http://yentsun.com - персональный сайт
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I’m having a bit of trouble with the pagination template, the [+current+] placeholder doesn’t seem to be functioning. Have I missed something?
              <div class=”ditto_wrapper“>Page <strong>[+current+]</strong> of <strong>[+total+]</strong> Articles
              <div class="ditto_pages">[+previous+] [+pages+] [+next+]</div></div>
              [[Ditto? &summarize=`5` &paginate=`1` &paginateAlwaysShowLinks=`1` &sortby=`pagetitle` &sortDir=`ASC`]]
              <div class=”ditto_wrapper“>Page <strong>[+current+]</strong> of <strong>[+total+]</strong> Articles
              <div class="ditto_pages">[+previous+] [+pages+] [+next+]</div></div>

              The document is not cached.
                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
                • 4295
                • 98 Posts
                Try [+currentPage+]
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Yes! Thanks.

                    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
                    • 26435
                    • 1,193 Posts
                    Mark got me off to a really good start using the Reflect snippet to output a WP style blog archive. I have a few questions about the Reflect parameter &placeholder.

                    I use the &target parameter to link to another page that has a slightly different ditto template display tpl.

                    My Reflect archive outputs a list like this
                    December 2006
                    November 2006
                    October 2006
                    etc....

                    When I click on the November 2006 link, it it lists all the items from November 1st 2006 through November 31st 2006 (as I would have expected), but the Reflect archive list now only lists "November 2006" as its only link. That just doesn’t seem to be useful as I am already looking at all the items in November. I wonder if there is a way I can use the &placeholder parameter to get the placeholder from the blog page for generating the output of the Reflect list on the archive page so when I click on November, I can read all the items from November, but still choose another month from the list, such as December, or October. is this possible?

                    -sD-
                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 26435
                      • 1,193 Posts
                      Also, I have a document/container called categories with a document for each tag (my TV is called "tags".
                      In each of these documents I have a ditto call with the parameters

                      &tagDelimiter=`,` &tagData=`tvtags` &tagMode=`onlyTags` &tags=`Pirate`

                      In Ditto 1.0.2, this page displayed all the documents with the tag "Pirate", but in 1.1 beta 2 it just outputs "No entries found"

                      What changed here? What am I doing wrong. When I go back to 1.0.2 it works fine, but then [[Reflect]] doesn’t work.
                      embarrassed
                      -sD-
                        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                        All of the above... in no specific order.


                        I send pointless little messages