We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    @doze: No, not yet, but I plan on allowing that via a parameter.

    @openfire3: You are not running MODx 0.9.2.1. Please upgrade your MODx installation to the latest release.
      • 22302
      • 42 Posts
      @mark: yes I am : Benoit Deziel.com - MODx 0.9.2.1 (rev 1005) wink

      Also, I have another site running MODx 0.9.2.1 (rev 1005) on the same server and Ditto is running perfectly. I copy/paste the code for Ditto from this other site but I still get this error. Maybe my MODx installation is corrupt?
        [b]Benoit Deziel[b]
        • 25663 MODX Staff
        • 12,272 Posts
        definitely sounds like a filesystem corruption... reupload the ditto stuff in the snippets folder first then the manager stuff is that doesn’t work...
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 22302
          • 42 Posts
          already been done...

          I think that ditto corrupted the filesystem, because before installing the new version, everything was fine and I haven’t install anything else recently.
            [b]Benoit Deziel[b]
            • 18397
            • 3,250 Posts
            Refresh your cache files and try running Ditto again.
              • 22302
              • 42 Posts
              Still not working... If i run the updater again can it work?

              @mark: Can I PM you an user/pass for the manager to check it out?
                [b]Benoit Deziel[b]
                • 7923
                • 4,213 Posts
                Quote from: Mark at Jul 12, 2006, 11:05 PM

                @doze: No, not yet, but I plan on allowing that via a parameter.
                Ok, I’ll be waiting for that.. I’ll try to do some initial snippet with the available fields for now and update it when this is done. Thanks!


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 7923
                  • 4,213 Posts
                  When using JSON as the output format in ditto, is there a way to prevent it breaking the content field into multiple lines? If I use javascript eval() on the output, it errors saying "Unterminated string constant". But if I remove the linebreaks, it gets evaled ok.

                  So to make it perfectly clear, currently it outputs this (what is not evaling):
                  { "title":"test", "link":"http://localhost:8080/eclipse/modx/index.php?id=39", "description":"", "language":"english", "copyright":"My MODx Site 2006", "copyright":"My MODx Site 2006", "ttl":"120", "entries":[ { "title":"Another title", "link":"http://localhost:8080/eclipse/modx/index.php?id=42", "description":"61.438767,23.730469", "content":"
                  More content here
                  
                  ", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=42", "author":"Built-in Administration account" }, { "title":"Some title", "link":"http://localhost:8080/eclipse/modx/index.php?id=41", "description":"60.239811,25.048828", "content":"
                  Content here
                  
                  ", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=41", "author":"Built-in Administration account" } ] }


                  and when changed to this, it evals ok:
                  { "title":"test", "link":"http://localhost:8080/eclipse/modx/index.php?id=39", "description":"", "language":"english", "copyright":"My MODx Site 2006", "copyright":"My MODx Site 2006", "ttl":"120", "entries":[ 
                  { "title":"Another title", "link":"http://localhost:8080/eclipse/modx/index.php?id=42", "description":"61.438767,23.730469", "content":"More content here", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=42", "author":"Built-in Administration account" }, 
                  { "title":"Some title", "link":"http://localhost:8080/eclipse/modx/index.php?id=41", "description":"60.239811,25.048828", "content":"Content here", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=41", "author":"Built-in Administration account" } ] }


                  The contents of "content" field to json comes from [+summary+] placeholder.

                  Btw. json is missing from the documentation as possible value to &format parameter..

                  EDIT: also, is there a reason why copyright is twice at the first block?


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 18436
                    • 135 Posts
                    I have a pet hate and that is ListRelated, is there anyway using perhaps the tag parameter to simulate the behaviour of ListRelated using ditto?
                    I don’t want to tag documents at this stage, since I am utilising keywords and metatags and I think this functionality would push ditto beyond the realm of ubercool.

                    Any ideas?
                      • 7923
                      • 4,213 Posts
                      Would you consider to allow passing template code right at the snippet call or a path to filesystem.

                      So when using Ditto in another snippet, I would not need to have ditto’s templates allways in chuncks when I want to output in some specific format to my snippet. Could do something like:

                      $dittoOutput = $modx->runSnippet("Ditto", array("tpl" => "<post><title>[+title+]</title><summary>[+summary+]</summary></post>"));

                      or

                      $dittoOutput = $modx->runSnippet("Ditto", array("tpl" => "assets/snippets/mysnippet/dittochunk.tpl"));

                      So maybe do something like in Ditto when getting the templates from snippet parameters:

                      $tpl = isset($tpl) ? $ditto->getTpl($tpl): $_lang['default_template'];
                      
                      function getTpl($tpl){
                      	global $modx;
                      	$template = "";
                      	if ($modx->getChunk($tpl) != "") {
                      		$template = $modx->getChunk($tpl);
                      	} else if(file_exists($tpl)) {
                      		$template = file_get_contents($tpl);
                      	} else {
                      		$template = $tpl;
                      	}
                      	return $template;
                      }



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

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