I think I’ve found a logical flaw / bug in Ditto 1.0.2.
I tried to do the following:
[tt][!Ditto? &tpl=`DittoTemplateNorsk` &startID=`4`
&summarize=`2` &trunc=`0` &truncSplit=`0` &displayArchive=`0` &sortBy=`pub_date`!]
BANNER
[!Ditto? &tpl=`DittoTemplateNorsk` &startID=`4`
&start=`2` &summarize=`2` &trunc=`0` &truncSplit=`0` &displayArchive=`0` &sortBy=`pub_date`!]
BANNER
[!Ditto? &tpl=`DittoTemplateNorsk` &startID=`4`
&start=`4` &summarize=`5` &trunc=`0` &truncSplit=`0` &displayArchive=`0` &sortBy=`pub_date`!]
[/tt]
i.e.:
- Show the 2 newest articles (&summarize=`2`)
- display a banner
- display two more articles (&start=`2` &summarize=`2`)
- display a banner
- display five more articles (&start=`4` &summarize=`5`)
This will not work since the loop (on line 405) displaying the articles runs from &start to &summarize. To fix this, I’ve applied this patch to my installation (line 126-132):
if ($paginate == 1 && $_GET['start'] != 0) {
$start= isset($_GET['start'])? $_GET['start']: 0;
// get post # to start at
}else{
$start = isset($start) ? $start : 0;
// get start number
$summarize = $summarize + $start; // MY PATCH, incrementing summarize with $start
}
I’m rather new to MODx and Ditto so I might be wrong, please comment.
../Per