I’m trying to use Ditto to create pagination for a group of pages where I want ditto to display one entire page at a time but where you can navigate through the group of pages using the pagination.
Ditto version 2.1.0 with modx 1.0.2
I’ve got this working using the [+content+] placeholder in my artistContent chunk (&tpl=`artistContent`) as long as there are no TVs in the content.
However, when I try and use TVs to replace any of the "hard coded" html (for client ease of use) in the content section of the target pages the TVs just seem to get ignored. I tried switching the TVs from [*tvName*] to [+tvName+] in my target page’s resource content section but that doesn’t help. If I leave the TV as [*tvName*] and add the TV to the container where the Ditto call is executed then the TV is parsed properly but of course that doesn’t help me because I need the TV from each target page.
Ditto call from the container of the group of pages:
[!Ditto? &parents=`[*id*]` &tpl=`artistContent` &noResults=`DittoNoResults` &orderBy=`pagetitle ASC` &display=`1` &paginate=`1` &paginateAlwaysShowLinks=`1`!]
<p>[*pagetitle*] | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong> </p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>
artistContent chunck:
HTML from resource content with TVs (when hard coded page displays properly):
<script type="text/javascript" src="assets/js/slimbox2.js"></script>
<div id="centerwrapper">
<div id="box1">
<a href="[+image1+]" rel="lightbox" title='[+caption1+]'><img width="[+img1w+]" height="[+img1h+]" src="[+image1+]"/></a>
<p>[+caption1+]</p>
</div>
I’ve tried turning off the page caching for both the target page and the container but neither helped.
I’ve also tried adding in PHx (2.1.3) because of some posts I’ve read, which broke pagination until I got the cached and uncached calls and pages tweaked correctly, but TVs still didn’t get parsed, do I need to do something besides just install and enable PHx for it to help??
I really hope I’m just overlooking something simple that will get this to work.
Any suggestions are welcome, I’ve got a deadline coming up and just can’t figure out why this won’t work!! If Ditto is not the right way to do this please let me know.
Thanks,
-Paul