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
    I reccomend that you set all of the documents relating to Ditto to published while you are setting up the script. Once you have done that, you can start to use options to control whether unpublished items are shown or not.

    The documents inside the folder are children of the folder. Their parent should be the folder.

    Would a screencast help?
      • 23044
      • 20 Posts
      A screencast would be great! I’m a Perl and Ruby man so I’m trying to get a grip on PHP and MODx at the same time. PHP seems pretty straight-forward and elegant for the most part and I’m picking it up quickly. Thanks for the help!
        • 23044
        • 20 Posts
        Quote from: Mark at Jul 18, 2006, 08:43 PM

        I reccomend that you set all of the documents relating to Ditto to published while you are setting up the script. Once you have done that, you can start to use options to control whether unpublished items are shown or not.

        The documents inside the folder are children of the folder. Their parent should be the folder.

        Would a screencast help?

        Got it working! Thanks.

        Now I’m trying to figure out why each news item summary is wrapped in <code></code> tags. In ditto.class.inc.php I see two if statements that prepend/append the code tags to $output if debug is turned on but I haven’t yet found out where to check for that var. I need to get rid of those code tags since I have CSS styles on all code tags and it’s wrecking the layout. Can you point me to a solution?
          • 18397
          • 3,250 Posts
          If you have &debug=`1` in your snippet call, then debug mode is on. If you do not set this then the code tags should not be enabled.
            • 23044
            • 20 Posts
            I checked that out and I’m not passing the debug param at all. I’ve tried explicitly setting it to ’0’ in the snippet call but it doesn’t change anything which was a silly exercise because the terniary operator will set it to ’0’ if !isset anyway. I’m at a loss here. I could pm you the url or set up a temporary /manager login for you if you want to look further.
              • 18397
              • 3,250 Posts
              I would be happy to take a look at it for you.
                • 18397
                • 3,250 Posts
                Problem Solved.

                The code tags were actually in the document and not being output by Ditto.
                Most likely the RTE (FCKeditor) kept them as the call was copied from the Ditto documentation.
                  • 27285
                  • 29 Posts
                  Quote from: Mark at Jul 18, 2006, 06:50 PM

                  If you are saying that you wish to remove the documents with the value of Filter being MPC then your filter parameter is correct.

                  And what if I want that only the documents with the value "MPC" (in the longtitle) are shown?

                  Quote from: simon79
                  How can I write a tv to select a filter which has the output of a certain word (e.g. MPC)?

                  It would be great if you can post an example for a tv I can use. I still have problems with creating a template variable that works.
                    • 18397
                    • 3,250 Posts
                    You would use != in the last parameter.
                      • 31113
                      • 45 Posts
                      I found bug id Ditto, if news count = 0.

                      Ditto version: 1.0.2
                      PHP version: 5.1.4
                      problem: PHP error in function `array_values`

                      Snippet code:
                      $resource = array_values($resource);

                      don’t work, because $resource==false

                      Construction
                      if (count($resource) < 1) { return $emptyText."\n"; }

                      don’t work, because count(false)==1

                      solution
                      in ditto.class.inc.php, line 129:
                      $resource = $modx->getDocuments($kids, $showPublishedOnly, 0, "*", $where, $sortby, $sortdir);
                      // get actual documents
                      
                      // ---------------------------------------------------
                      // Append tv's to array
                      // ---------------------------------------------------
                      
                      $this->appendTVs($resource, $tvnames);
                      
                      return $resource; <------!!!!


                      change marked line to:
                      return $resource ? $resource : array(); 

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