We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    This is an auto-generated topic for <a href="http://modxcms.com/extras/package/96">Ditto 3.0-alpha2</a> by splittingred.

    Brief Description:
    Initial MODx Revolution port of Ditto. No new features; old features should work as expected.
      • 17230
      • 35 Posts
      Hi there,

      Ditto calls just partly work as expected for me in modx Revolution beta 5.

      My basic Ditto call:
      [[Ditto? &parents=`8` &display=`5` &total=`5` &orderBy=`createdon ASC` &dateSource=`createdon` &dateFormat=`%d.%m.%Y` &tpl=`DittoNewsTpl` &tplLast=`DittoNewsTplLast`]]


      The corresponding "DittoNewsTpl" looks like this:
      <div class="blog_entry">
      	<div class="blog_head">
      		<p class="blog_date">[[+date]]</p>
      		<h3 class="blog_heading">[[+pagetitle]]</h3>
      	</div>
      	<p class="blog_category">Kategorie: <a href="#"></a></p>
      	<div class="blog_text">[[+content]]</div>
      </div>
      <div class="content_divider"></div>
      


      Pagetitle and content seem to work, whereas date always delivers "1.1.1970" (or plain "0" in Unix Time). If I try to access documents with pub_date instead of createdon, Ditto outputs "No documents found".

      When I try to access a custom TV like this:

      <p class="blog_category">Kategorie: <a href="#">[[+category]]</a></p>


      parsing of the page breaks completely. I’ve tried various output formattings for the TV, but nothing changes. This is the output from the modx backend Error Log:

      [2010-02-09 14:30:00] (ERROR @ /web/***/core/components/tinymce/tinymce.class.php : 94) PHP warning: array_merge() [<a href=’function.array-merge’>function.array-merge</a>]: Argument #2 is not an array.

      Correct me, if the fault’s on my side, please ;-)
      Thanx for your great effort & work you put into Ditto!

      Cheers, Liquinaut
        - Just because you&#39;re not paranoid doesn&#39;t mean they&#39;re not after you -
        • 12793
        • 293 Posts
        Hi! I’ve installed Ditto package (3.0 alfa)

        In my page I’ve inserted

        [[Ditto? &parents=`8` &display=`5` &total=`5` &orderBy=`createdon ASC` &dateSource=`createdon` &dateFormat=`%d.%m.%Y` &tpl=`DittoNewsTpl` &tplLast=`DittoNewsTplLast`]]

        but I can’t show contents

        how Can I insert items (artciles??)

        I’ve only to insert this:
        [[Ditto? &parents=`8` &display=`5` &total=`5` &orderBy=`createdon ASC` &dateSource=`createdon` &dateFormat=`%d.%m.%Y` &tpl=`DittoNewsTpl` &tplLast=`DittoNewsTplLast`]]

        in my page or I’ve to insert other informations?? I’ve read this post but I don’t know that I’ve to insert and what is already in package installed

        Thanks
          • 12793
          • 293 Posts
          Nobody Can help me??
            • 17230
            • 35 Posts
            Hey,

            there are a lot of good resources you can start learning about Ditto, but I’d start with an introduction to modx revolution and its syntax first:

            http://svn.modxcms.com/docs/display/revolution/MODx+Revolution

            The Ditto call you copied from my post won’t get you anywhere, to be honest wink. First of all I think it’s best to have a basic understanding of how the main parts of modx work: templates, snippets, template variables & chunks - and how these parts interact with eachother. Don’t be afraid, it’s not rocket science and once you get into it you’ll be blown away by the power and flexibility you have at your fingertips smiley

            Once you know a bit about how snippets (like Ditto) work, you’ll find a basic setup for a Ditto call and how it can be extended here:

            http://wiki.modxcms.com/index.php/Ditto

            But(!) as i assume you work with modx Revolution, be aware that Revolution is still beta and the documentation of Ditto refers to modx Evolution. This is important, because the main syntax of Placeholders has changed from Evo to Revo:

            http://svn.modxcms.com/docs/display/revolution/Tag+Syntax

            So if you begin setting up your Ditto calls, update the corresponding Placeholders in your chunks with the new syntax. Maybe you’re even better off with modx Evolution for this time being? It’s not beta anymore, it’s very well documented and once you’ve got that up and running, you can step up to Revolution. Just my two bits wink

            Another good resource to learn about Ditto is it’s own homepage:

            ditto.modxcms.com/

            Ditto is extremely powerful and can be tweaked and customized very far as you soon will learn. But again: You’ll discover the power of Ditto best, if you’ve got the basics of modx itself right. That’ll give you everything you need to handle Ditto and a lot of other snippets as well!

            Cheers, Paul


            P.S.: Copying my Ditto call wasn’t a good idea anyway, as it doesn’t work for me either. That’s why I posted here. wink
              - Just because you&#39;re not paranoid doesn&#39;t mean they&#39;re not after you -
              • 12793
              • 293 Posts
              Thanks for help me!!!

              Now it works!!
                • 3749
                • 24,544 Posts
                Paul:

                I think you may want publishedon rather than pub_date. The pub_date and unpub_date hold the scheduling dates rather than the date of publication and they’re often empty.

                Also, the Unix timestamp dates need to be processed something like this (note the back-ticks):

                [[*createdon:strtotime:date=`%m-%d-%Y`]]


                About your custom TV -- two thoughts. First turn off the Rich Text Editor. Second, see if taking out the colon helps.

                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 17230
                  • 35 Posts
                  Hey BobRay, thanx for your reply!

                  I’ve tried everything you suggested (and even some more), but unfortunately it doesn’t really get better. And more questions arise undecided

                  publishedon:

                  This TV gets rendered correctly when processed like you suggested (Only using a "+" instead of a "*" here - it’s a placeholder inside the template chunk):
                  [[+publishedon:strtotime:date=`%d.%m.%Y`]]


                  When used in the Ditto Call like this:
                  [[!Ditto? &parents=`8` &display=`2` &total=`2` &orderBy=`publishedon DESC` &tpl=`DittoHomeNewsTpl` &tplLast=`DittoHomeNewsTplLast`]]


                  Ditto outputs "No documents found". That’s the same behavior I encountered with the pub_date TV before, even if that wasn’t empty. BTW, I didn’t find the TV publishedon to be documented anywhere, it’s not listed here: http://svn.modxcms.com/docs/display/Evo1/Document+Variables and I couldn’t find nothing about it in the Revo Docs, as I was already searching for that TV before. And is there any decent documentation about the formatting possibilities inside placeholders?

                  Custom TV

                  I tried to simply disable TinyMCE for the chunks and disable the "Rich Text" checkmark for the Blog Entry’s as well, but that doesn’t work out - the rendering of the page still breaks complety when using a custom TV as a placeholder. And: TinyMCE is automatically enabled again when I open the chunk another time in the backend. But then again I think the error report for TinyMCE has to do with it’s unability to process Links correctly ATM, so this is another issue to be dealt with elsewhere wink Nonetheless: here’s the complete error log for a request with a custom TV inserted as a placeholder and TinyMCE installed:
                  [2010-02-13 10:18:54] (ERROR @ /index.php) Error 42S22 executing statement: 
                  Array
                  (
                      [0] => 42S22
                      [1] => 1054
                      [2] => Unknown column 'modTemplateVaraResource.contentid' in 'order clause'
                  )
                  
                  [2010-02-13 10:19:01] (ERROR @ /web/***/core/components/tinymce/tinymce.class.php : 94) PHP warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array


                  After completely uninstalling TinyMCE the problem still exists. I get the following (reduced) output from the error log:
                    [2010-02-13 10:27:17] (ERROR @ /index.php) Error 42S22 executing statement: 
                  Array
                  (
                      [0] => 42S22
                      [1] => 1054
                      [2] => Unknown column 'modTemplateVaraResource.contentid' in 'order clause'
                  )
                  


                  Removing the colon doesn’t work out for me either, so I’m still not able to access the custom TV.

                  That’s it so far... thanx alot for your effort!
                  Cheers, Paul
                    - Just because you&#39;re not paranoid doesn&#39;t mean they&#39;re not after you -
                    • 3749
                    • 24,544 Posts
                    The publishedon resource field (we don’t call the built-in ones TVs any more) and others are documented here: http://www.bobsguides.com/revolution-objects.html. smiley

                    I’ve always had the RTE in Revo disabled in System Settings (use_editor -> No) so I don’t know what to suggest on your other problem. It looks like TinyMCE is the culprit, though.


                    Edit the TV itself in the Element tree and make sure you haven’t got any Rich Text features enabled there.

                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 12793
                      • 293 Posts
                      Hi! Using ditto is it possible to order the restult using this field:

                      Published On

                      (that I find in page settings)


                      Thanks