We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4945
    • 3 Posts
    Quote from: kylej at Aug 22, 2006, 07:35 PM

    chapi456,

    ditto is just truncating the content and that is why the output looks different.

    I think ditto will have a customizable template for json output in the next version and you will be able to remove the content from the json output so it will work for you.

    Thanks for your answer.
    BTW, sure Ditto truncate the content but I’m not sure it’s a template issue. IMO, it looks much more like a parser mistake than just a planned truncation.

    Once again, I hope I’m wrong smiley
      • 18397
      • 3,250 Posts
      Ditto is truncating the content. It uses an intelligent truncator to stop at x character but it extends x characters out to close tags at a certain point. You can turn this off by setting &trunc=`0` in your snippet call. Note that this will then return ONLY the document content and not the introtext. If for some reason that does not work set &truncLen to some gigantic # to trick the truncator into returning the entire string.

      Kyle,
      What about having DittoCal execute the Ditto snippet itself via $modx->runSnippet and capture the output? Then you wouldn’t have to worry about creating a document specifically for Ditto.
        • 15987
        • 786 Posts
        Quote from: Mark at Aug 23, 2006, 11:08 PM

        Kyle,
        What about having DittoCal execute the Ditto snippet itself via $modx->runSnippet and capture the output? Then you wouldn’t have to worry about creating a document specifically for Ditto.

        I thought about that, but then when Dittocal is called uncached it has to process the whole ditto request each time. I figured having it as a seperate document was more effiecient. I will give it a try though and see how it effects the performance.
          • 18397
          • 3,250 Posts
          Or maybe have it as an option?
            • 17673
            • 194 Posts

            this snippet looks GOOD, you gave me a good reason to finally upgrade my modx installation !

            Since you seem pretty Ajax-literate (AjaxSearch)Is an ’Ajaxification’ of the calendar in the works?!?
            I think it would be great to have different months sliding-in from left and right when clicking on the back-forward arrows !!
              ----------------------------------------------------------
              http://www.linkedin.com/in/lucapost/
              http://www.twitter.com/lukwe/
              ----------------------------------------------------------
              • 7923
              • 4,213 Posts
              What I would like to see in DittoCal is the borderline day numbers for next/prev month also.. now it just has empty cells.


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 17673
                • 194 Posts

                I just got a DittoCal call working at http://www.bo.ingv.it/modx/contenuti/eventi.html, I do see weird behaviours which I’d like to solve before styling the calendar:

                1) - DittoCal categorizes document on the creation date, while Ditto standard placeholder [+date+] reports the ’last-edited’ date,
                this can get confusing for readers; probably you can just let the webmaster choose with an additional parameter &date = createdon | editedon


                2) - I have 4 articles on a single date; but when I click that day only the first one gets displayed, despite the fact that they are all present in the json file


                3) - once 2) is solved, how do I pass parameters to the embedded Ditto-call you must be using for the calendar links, for example I would need to specify the Ditto &tpl to recover a Chunk for Placeholders
                  ----------------------------------------------------------
                  http://www.linkedin.com/in/lucapost/
                  http://www.twitter.com/lukwe/
                  ----------------------------------------------------------
                  • 15987
                  • 786 Posts
                  DittoCal categorizes document on the creation date, while Ditto standard placeholder [+date+] reports the ’last-edited’ date,
                  this can get confusing for readers; probably you can just let the webmaster choose with an additional parameter &date = createdon | editedon

                  The data DittoCal uses comes from the json craeted with ditto. I’m not sure, but if you can have ditto output the editedon date instead of the created date that should fix this for you.

                  I have 4 articles on a single date; but when I click that day only the first one gets displayed, despite the fact that they are all present in the json file

                  currently there is no way to handle this. I will add this to the list of things to workon.

                  3) - once 2) is solved, how do I pass parameters to the embedded Ditto-call you must be using for the calendar links, for example I would need to specify the Ditto &tpl to recover a Chunk for Placeholders

                  I’m not sure I understand what you are looking for here? I think what will need to ahppen to solve to that will in turn solve three will be the following: If there are multiple articles on the same day it will link to a page containing a ditto call. The date will get passed to the page and will be used as the filter in the ditto call. So on this page you would set your template and other ditto params as needed. I will have to spend sometime working out the specifics though.

                  Since you seem pretty Ajax-literate (AjaxSearch)Is an ’Ajaxification’ of the calendar in the works?!?
                  I think it would be great to have different months sliding-in from left and right when clicking on the back-forward arrows !!

                  I have been thinking about this and definatly have this on my todo list.
                    • 17673
                    • 194 Posts


                    1) - 3)
                    as it is in the current implementation the calendar creates a link to a single-event page, this page does not actually contain a call to Ditto; i’ll wait for a future release to figure out everything -good to know it’s not something wrong in my snippet call
                      ----------------------------------------------------------
                      http://www.linkedin.com/in/lucapost/
                      http://www.twitter.com/lukwe/
                      ----------------------------------------------------------
                      • 19645
                      • 23 Posts
                      I have the Dittocal installed and running. I only have an odd problem. The month that is being display by DittoCal is December 1999, when I open blog.html. When I click (next) >> I get blog.html?calmonth=01&calyear=0 and January 2000.

                      The code below shows that DittoCal looks for querystrings calmonth and calyear. Somehow it seems to find 0 values for those querystrings, even if there are no querystings available in the url?

                      //Use the month & year passed-in if set else use first post as month & year
                      if (isset($_GET['calmonth']) && isset($_GET['calyear'])) {
                          $filterMonth = $_GET['calmonth'];
                          $filterYear = $_GET['calyear'];
                      } else {
                          $filterMonth = substr($postData->entries[0]->pubDate,3,2);
                          $filterYear = substr($postData->entries[0]->pubDate,6,4);


                      I also tried this:
                      //Use the month & year passed-in if set else use first post as month & year
                      if (isset($_GET['calmonth']) && isset($_GET['calyear'])) {
                          $filterMonth = substr($postData->entries[0]->pubDate,3,2);
                          $filterYear = substr($postData->entries[0]->pubDate,6,4);
                      } else {
                           $filterMonth = $_GET['calmonth'];
                          $filterYear = $_GET['calyear'];


                      This also gave December 1999 as output.

                      I am using DittoCal 1.1 with Ditto 1.1beta2