We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30144
    • 6 Posts
    Hi,

    I have been following the Ditto custom template tutorial and have not been able to get it to work.

    I have copied the code straight from the tutorial. I have [!Ditto &tpl=`DittoTemplate`!] called in my template.

    I have a chunk named DittoTemplate with the following.

    <div class="ditto_item" id="ditto_item_[+id+]">

    <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3>

    <div class="ditto_documentInfo">by <strong>[+author+]</strong> on [+date+]</div>

    <div class="ditto_introText">[+introtext+]</div> </div>

    Everything worked fine until I started to try different things with the template.

    I am probably looking over something very simple. I would appreciate any help.

    Thanks!
      • 18397
      • 3,250 Posts
      Could you describe the problem in more detail?
        • 7231
        • 4,205 Posts
        I am guessing that you are adding [!Ditto &tpl=`DittoTemplate`!] directly into your template, and now it is appearing on all the pages with different content. Here are some tips:

        1) don’t add the call directly into the template, add it to the content field so that it only shows on that specific page;
        2) add a &parents parameter to be able to specify where to look for documents, without that parameter it will default to the current doc id.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 11975
          • 2,542 Posts
          Hi,

          It seems that you missed the ?

          [!Ditto? &tpl=`DittoTemplate`!]
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 30144
            • 6 Posts
            ? That was it.

            Thanks.