Question

I'm having difficulty getting the pagination functionality working with [[Ditto? ... ]] in MODx CMS.

I have the documents displaying in the page, limit is set to 5. The output from my other pagination template placeholders seem to be working but the [+next+] link doesn't load the next set of 5 documents (going in descending date order).

Here's my template code:

[[Ditto?
    &parents=`13`
    &tpl=`ArticleListChunk`
    &display=`5`
    &&removeChunk=`Comments`
    &paginate=`1`
    &extenders=`summary,dateFilter`
    &paginateAlwaysShowLinks=`0`
    &dateFormat=`%F %D %Y`
]]

<p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles</p>
<ul class="clearfix">
    <li>[+previous+]</li>
    <li>Page <strong>[+currentPage+]</strong> of [+totalPages+]</li>
    <li>[+next+]</li>
</ul>


The output I get is:

Showing 1 - 5 of 17 Articles

Page 1 of 4
Next >


as you can see the output is correct, however when I click the 'next' link the resulting URL is .../news.html?start=5 but the content of the page stays the same (i.e. the latest 5 documents are shown!).

This is how the template and functionality was when I was inherited this project from a client, and I have never used MODx CMS before -- can anyone help me please?

I there a way to update the SQL offset with a parameter or something? I've been all through the Wiki pages for Ditto / MODx but can't find what I need or what I should be doing that I'm not!

Was it helpful?

Solution

I would think you need to call ditto uncached [[!Ditto? attribs ]]

That's just a guess.

Also it looks like you are using EVO? check the cache syntax, you might need to put an exclamation mark at the end as well. [[!Ditto? attribs !]]

OTHER TIPS

After plenty of searching I found a post on the MODx forum that pointed me in the right direction.

Turns out that caching was enabled in the page/document's settings (doh!). I disabled this and now it works fine!

However I have not set the no-caching token ('!') in Ditto's parameter string which, including the answer from Sean, my research has suggested is advisable and/or required. I've not worked with MODx before so I can't say for certain, but it seems to work without this for me!

Thanks @SeanKimball as your answer set me down the right path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top