We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21092
    • 54 Posts
    neelhtak_backwards Reply #1, 17 years ago
    Ok,
    I have a problem that is driving me insane. I have the exact same ditto call (with change of page id’s) on multiple pages, and for some reason it is starting to show up incorrectly.

    Below is a simplified version of my site tree:

    - Writing Lessons
    - Lessons 1
    - My Stories
    - Story 1
    - Chapter 1
    - page 1
    - page 2
    - Story 2
    - Chapter 1
    - page 1
    - page 2
    - Featured Authors
    - Author 1
    - Story 1
    - Chapter 1
    - Page 1
    - Author 2
    - Story 1
    - Chapter 1
    - Page 1

    The ditto call is :
    [[Ditto? &parents=`116` &display=`5` &removeChunk=`Comments` &tpl=`articletemplate` &paginate=`0` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`0` &tagData=`documentTags`]]
    
    Showing [+start+] - [+stop+] of [+total+] Articles
    
    [+previous+] [+pages+] [+next+]




    The code I use for the chapter one levels is:
    [!Ditto? &display=`1` &removeChunk=`Comments` &tpl=`novel_template` &paginate=`1`  &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &orderBy=`menuindex ASC`!]
    
    Showing [+start+] - [+stop+] of [+total+] Articles
    
    [+previous+] [+pages+] [+next+]
    {{comments}}


    The problem:

    On the page My Stories I see the links "Story 1" and "Story 2". However, on the page Featured Authors I see the links "Author 1", "Story 1" (from author 1), "Author 2" and "Story 1" (from author 2). What I want it to display is just "Author 1" and "Author 2"...
    I should also point out that Chapter 1 (in any level) has pagination turned on, and thus needs to show all children pages as pagination.

    What is going wrong? Why is the Featured Authors section showing children multiple levels down when all the other pages show just one child down the hierarchy??


    Modx version 1.0.1 Evolution
      Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
      • 3749
      • 24,544 Posts
      Try calling it uncached:

      [!Ditto ... !]


      Clear the site cache and your browser cache before testing it.
        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
        • 21092
        • 54 Posts
        neelhtak_backwards Reply #3, 17 years ago
        I just turned on the uncached ditto - no change... Thanks for suggestion BobRay.

        I noticed, when I duplicated the My Stories section of the website, changed the headings and put different content in the bottom most child documents, it worked fine.
        - My Stories (changed to featured authors)
        - Story 1 (changed to author name)
        - Chapter 1
        - page 1
        - page 2
        - Story 2
        - Chapter 1
        - page 1
        - page 2

        However, as soon as I added a container for the novel name between the new author name, and chapter one, I got the duplication issue again.

        - My Stories (changed to featured authors)
        - Story 1 (changed to author name)
        - make this their story name...
        - Chapter 1
        - page 1
        - page 2

        The new container had exact same code as Story 1 (now known as author name), with change of &parent id.

        Any suggestions?
          Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
          • 21092
          • 54 Posts
          neelhtak_backwards Reply #4, 17 years ago
          IF you wish to see the working model, the link to the Authors page is:
          http://katskinner.com/index.php?q=131.html

          I am doing live testing, so if that page doesn’t work when you click it, go back to the main index and browse to either Authors or Featured Authors section.
            Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
            • 3749
            • 24,544 Posts
            I’m not sure it will solve your problem, but I think a &parents parameter is required for all Ditto calls.

            You can use [*id*] if the parent is the current page, or you can use a TV for it if not.
              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
              • 22840
              • 1,572 Posts
              However, on the page Featured Authors I see the links "Author 1", "Story 1" (from author 1), "Author 2" and "Story 1" (from author 2). What I want it to display is just "Author 1" and "Author 2"...

              Have you tried adding &level=`1` in the call, that would tell ditto to only display the first level

              ( I think &level is correct but it may be something like &depth, check the ditto parameters for more )
                • 21092
                • 54 Posts
                neelhtak_backwards Reply #7, 17 years ago
                Hey all,
                Thanks heaps for your help its really apprecaited - I ended up figuring it out on my own. I tried doing the &levels and &depth, but it didn’t change anything (or it produced undesired results).

                SOLUTION:
                All my templates "&tpl" contains the code to show a title, the creation date, and a SUMMARY. What I didn’t realize, is when you don’t add a summary in the back end of modx it shows the child document as the "Summary".
                So, as soon as I added a summary to the pages, it stopped showing the child documents.


                So over all, issue SOLVED. I hope this helps others.
                  Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.