Hi Mark,
thanks for the great improvements
I discovered a little problem with the altRows/firstRow/lastRow functionality. Let´s say you just want to alter the background color of the rows and you don´t have a determined number of documents to show with ditto yet:
[[Ditto? &tpl=`DittoTemplate` &startID=`2` &summarize=`50` &tplAltRows=`DittoTemplate_alt` ]]
In case of 5 (or any uneven number of) documents it works:
doc1 - DittoTemplate (=firstRow=tpl) -> for example black background
doc2 - DittoTemplate_alt (=altRow) -> for example white background
doc3 - DittoTemplate (=Row) -> for example black background
doc4 - DittoTemplate_alt (=altRow) -> for example white background
doc5 - DittoTemplate (=lastRow=tpl) -> for example black background
However, if you add a document the listing breaks:
doc1 - DittoTemplate (=firstRow) -> black background
doc2 - DittoTemplate_alt (=altRow) -> white background
doc3 - DittoTemplate (=Row) -> black background
doc4 - DittoTemplate_alt (=altRow) -> white background
doc5 - DittoTemplate (=Row) -> black background
doc6 - DittoTemplate (=lastRow=tpl) -> black background
Problem imho is that the first and last row template are defined by default as the "normal" row. And no, it doesn´t make a difference if I define first and last row templates, because at a change of the total number of documents (even or uneven), it will not work.
You have in ditto.class.inc around line 387:
// determine current template
$currentTPL = $tpl;
if ($format == "rss") {
$currentTPLname = "rss";
} else
if ($format != "archive") {
$currentTPLname = "TPL";
if ($x % 2) {
$currentTPL = $altRows;
$currentTPLname = "altRows";
}
if ($x == 0) {
$currentTPL = $firstRow;
$currentTPLname = "firstRow";
}
if ($x == $stop -1) {
$currentTPL = $lastRow;
$currentTPLname = "lastRow";
}
}
I commented out the last two if clauses, so it works for me (because I don´t need first and last row). But I think it would be better to start this routine with first and last row templates not until first and/or last row templates are defined in the snippet call.
I hope this is understandable
Marc