We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36112
    • 24 Posts
    I have a set of news I wish to publish at one of my pages using Ditto.
    With Ditto installed I set content of the page to [[!Ditto? &parents=`12`!]], and everything works like a charm.. but..

    I want to style the results myself, and found out how to do this, but after adding the chunk in &tpl=´mychunktemplate´ I get this result on my page..
    &tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it.

    Whats wrong? Here are my chunk and ditto call..

    [[!Ditto? &parents=`12` &tpl=`mychunktemplate` !]]

    Chunk code (html):
    <h3><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
    [+introtext+]
    <a href="[+url+]"> read more...</a>

    Hope someone can help me with this.. Thanks
    • Mark Hamstra Reply #2, 13 years ago
      Chunk names are case sensitive (ie someThing is not the same as something).

      You also seem to be mixing up Evo & Revo syntax.. Evolution uses [[Snippet]] or [!Snippet!] uncached, whereas Revolution uses [[Snippet]] or [[!Snippet]] uncached. Perhaps that is confusing the parser.

      Are you also using the right backticks (``) in your content? You seem have used other ones in your post, so that’s worth triple checking.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 36112
        • 24 Posts
        Hmm, Ive been over everything now, I kinda knew something was an Evo/Revo issue, as I read a tutorial for Evo, and using Revo... But doing everything you pointed out, I still have the same issue.. As for the backticks, Im using (`), not (’ or ´).. Any other tips?
          • 3749
          • 24,544 Posts
          This is what it would look like in Revolution (Ditto is deprecated and replaced by getResources):


          [[!getResources? &parents=`12` &tpl=`mychunktemplate`]]


          Chunk code (html):
          <h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
          [[+introtext]]
          <a href="[[~[[+id]]]]"> read more...</a>
          


          Be sure your Tpl chunk is called mychunktemplate and not myChunkTemplate -- it has to be exactly the same as the name in the tag.
            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
          • Mark Hamstra Reply #5, 13 years ago
            If you’re using Revolution (which version?) you should seriously consider using getResources instead - Ditto will break at 2.1 and was only ported to Revo to provide a faster (and thus cheaper) migration.

            I think if you install getResources, you will be able of simply replacing Ditto with getResources and it should work.

            Though you will need to modify your chunk - you are using Evolution syntax again wink Placeholders are [[+name]] in Revo.

            Some links to look at:
            http://rtfm.modx.com/display/revolution20/Tag+Syntax
            http://rtfm.modx.com/display/ADDON/getResources
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 36112
              • 24 Posts
              Great! Thanks alot, I just started using Modx a few days ago, so this helps alot!
                • 36112
                • 24 Posts
                Hmm, sorry guys, I still cant get this to work.. Could FURLS have anything to do with it? Do I have to set up getResources in any way?

                This is how it looks now.:

                Page content:
                [[!getResources? &parents=`12` &tpl=`NyheterTemplate`]]

                Chunk: (NyheterTemplate)
                <h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
                [[+introtext]]
                <a href="[[~[[+id]]]]"> read more...</a>

                Nothing is now displayed on the page, in the content area...
                • Mark Hamstra Reply #8, 13 years ago
                  Did you install getResources through the Package Manager?

                  (System -> Package Manager, Download Extras, find getResources, hit Download, go back to the main screen and click Install and go through the prompt)


                  (I actually spend a while figuring out why getResources wouldn’t output anything before I realized I forgot to install it, this afternoon)
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • 8609
                    • 607 Posts
                    einsteinsboi Reply #9, 13 years ago
                    Apart from making sure you have getResources installed, you should be aware that:
                    1. By default getResources will not show documents that are hidden from the menu. So if your news items are hidden from the menu you need to add &showHidden=`1`.
                    2. Since you want to show the introtext, you also need to add &includeContent=`1`.
                      • 3749
                      • 24,544 Posts
                      Quote from: einsteinsboi at May 01, 2011, 11:40 PM

                      Apart from making sure you have getResources installed, you should be aware that:
                      1. By default getResources will not show documents that are hidden from the menu. So if your news items are hidden from the menu you need to add &showHidden=`1`.
                      2. Since you want to show the introtext, you also need to add &includeContent=`1`.

                      Good point. It also won’t show unpublished docs by default.
                        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