We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3875
    • 29 Posts
    Hi;
    I used to make basics ditto calls without any problems but since a few days i’m a bit confused because ditto seems not to work properly anymore.
    This is what i’m doing:
    in my template i have make a normal ditto call like this:

    [[Ditto? &parents=`15` &depth=`1` &display=`1` &tpl=`maintpl_zoom`]]

    in maintpl_zoom.tpl, i wrote:
    <h2>[+pagetitle+]</h2>
    <h3>[+introtext+]</h3>
    <p>[+content+]</p>


    I have on the same page a kind of summary generated by a ditto call, with a different ditto template. It displays the document titles normally, creating a link to them.

    When i click on the summary links, ditto always generates the results of the latest created document. Impossible to display an other document’s content.

    All i want, is display the content of the document specified in the url by the modx "id" parameter!

    It used to work before, but i must admit i’ve been wasting a lot of time trying to fix the problem.

    Please can someone help?
    thanks

      • 18397
      • 3,250 Posts
      Ditto will display the same content if the call is cached. Try changing the [[ to [! or by unchecking the page’s cacheable checkbox.
        • 3875
        • 29 Posts
        well that’s something i’ve tried, and it doesn’t work. it seems like if ditto doesn’t consider the "id" parameter in the url, and just displays the last document’s content.
        Does Ditto systematically consider that parameter before retrieving the content? or is it the chunk call who has the priority of what’s displayed in the page after the click?

          • 18397
          • 3,250 Posts
          After re-reading your post, it seems like there is an issue with the MODx cache or an astray plugin. Make sure you are not using the Template Changer plugin as it has several issues.
            • 3875
            • 29 Posts
            thanks for your answer but i still don’t understand. I don’t use the template changer plugin, and i’m just trying to make a basic ditto call.
            So i’ll show exactly what i did since i’ve been stuck on this for 1 week:
            I have my site template where i make my ditto calls:

            <div id="main" class="post">
            <h2 class="title"><span>Zoom</span></h2>
            [!Ditto? &parents=`15` &depth=`2` &display=`1` &tpl=`maintpl_zoom`!]

            <h3>Autres dossiers</h3>
            <ul>
            [[Ditto? &parents=`15` &depth=`2` &display=`10` &tpl=`autres_zoom`]]
            </ul>
            </div>


            then in my maintpl_zoom chunk, i have:

            <h2>[+pagetitle+]</h2>
            <img src="[+image+]" class="left">
            <h3>[+introtext+]</h3>
            <p>[+content+]</p>
            Posté par [+author+] le [+date+]

            where [+image+] is a basic image TV.

            In autres_zoom, i have:

            <li>
            <a href="[~[+id+]~]">[+longtitle+]</a>

            </li>


            That’s all.

            When i click on the generated links in autres_zoom, the content displayed by maintpl_zoom always belongs to the same document.

            I get crazy.
            PLease can someone help. I’ve read all tutorials and post and everything seems to be so easy.
            thanx.
              • 18397
              • 3,250 Posts
              Are you saying you want the first Ditto call to show the document you choose in the second?
                • 3875
                • 29 Posts
                yes, that’s what i’m trying to do. Is it possible this way?
                  • 18397
                  • 3,250 Posts
                  Why not just have the second Ditto call link to the actual page?
                    • 3875
                    • 29 Posts
                    to the actual page? if i do so, how am i supposed to get the content from my different documents?
                    you mean changing my autres_zoom chunk?
                      • 3875
                      • 29 Posts
                      Ok it finally works. I was using to much ditto calls, instead of simply using normal [*modx variables*].
                      Thanks for the support!