We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29181
    • 480 Posts
    I have spent a couple of hours trying to find a solution and don’t know where or what else to try now.

    Following the example at http://ditto.modxcms.com/tutorials/pagination.html I am trying to only display a certain number of testimonials on each page. As far as I can see I have done everything correctly.

    In my document content I have:
    [!Ditto? &startID=`38` &extenders=`summary,dateFilter` &dateSource=`pub_date` &dateFormat=`%D` &display = `3` &paginate = `1` &paginateAlwaysShowLinks= `1`!]
    
    <p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> testimonials | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong> </p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>


    As you can see at http://greenmountaingringo.us/testimonials.html none of the placeholders directly below the snippet call are being displayed.

    According to Bill Fernandez’ excellent documentation

    Any time that Ditto is called with &paginate set to "1", the following placeholders will be filled:

    [+total+] = An integer representing the number of items in the complete, unpaged list.

    [+start+] = All of the items in the complete, unpaged list are numbered sequentially starting at "1". This placeholder contains the sequential number of the first item included in the current page.

    [+stop+] = All of the items in the complete, unpaged list are numbered sequentially starting at "1". This placeholder contains the sequential number of the last item included in the current page.

    (These would typically be used to display a message along the lines of "now showing items 30 to 40 of 500 items". )



    [+currentPage+] = An integer representing the number of the current page being displayed.

    [+totalPages+] = An integer representing the number of pages available.

    (These would typically be used to display a message along the lines of "now showing page 3 of 50 pages". )

    [+pages+] = This placholder will contain what is essentially a random-access page-selctor, consisting of one HTML tag for each page in the set of pages, as follows:

    * For the current page, the tag will be a SPAN tag, assigned the CSS class "ditto_currentpage", and containing an integer corresponding to the page number.
    * For all other pages, the tag will be an A tag, assigned the CSS class "ditto_page", with the "href" attribute providing a link to the corresponding page, and containing (as the text visible on the page) an integer corresponding to the page number.

    I’m using Ditto 2.0.2 and MODx 0.9.6

    I would appreciate any pointers to the error of my ways.

    Taff
      Adrian Lawley: www.adrianlawley.com
      • 29181
      • 480 Posts
      Well I managed to get that working, but still not exactly sure how huh

      Ditto really is my Waterloo.

      Progressing on from there I need to summarise a randomly selected entry from ID 38. I need to "crop" the amount of text in there to place it neatly in front of a background image.

      [[Ditto? &startID=`38` &tpl=`testimonials_tpl` &trunc=`1` &truncOffset=`15` &truncLen=`100` &truncSplit=`0` &extenders=`summary,dateFilter` &randomize=`1`]]


      As you can see at the bottom of http://www.greenmountaingringo.us/our-story1.html it’s not truncating anything.

      Anybody want to help the "Ditto challenged"?

      Cheers,
      Taff

        Adrian Lawley: www.adrianlawley.com
        • 29181
        • 480 Posts
        Is anyone using truncation with Ditto 2.0.2 and it’s working?

        I’d really like to find a solution
        [[Ditto? &startID=`38` &summarize=`1` &total=`1` &extenders=`summary` &tpl=`testimonials_tpl` &truncLen=`20` &truncOffset=`12` &truncSplit=`1` &randomize=`1` &debug=`1`]]


        is my Ditto call, my tpl is:
        [+content+]<br />[+summary+]


        and it is just kicking out the exact same text twice.

        My only snack has been chips and salsa for over 30 years. I think I‘ve tried them all! Recently, I picked up a bag of your Tortilla Strips and salsa, the best I‘ve ever had! It‘s hard not to eat the entire bag and whole jar of salsa at one sitting! I try to eat healthy and love that your products are all natural and you use GMO free corn. I will only be eating your products from now on! Keep up the great work!
        My only snack has been chips and salsa for over 30 years. I think I‘ve tried them all! Recently, I picked up a bag of your Tortilla Strips and salsa, the best I‘ve ever had! It‘s hard not to eat the entire bag and whole jar of salsa at one sitting! I try to eat healthy and love that your products are all natural and you use GMO free corn. I will only be eating your products from now on! Keep up the great work!

        Thanks to anyone who can at least tell me if they have it working, and if so with what exact snippet call.

        Taff
          Adrian Lawley: www.adrianlawley.com