Bunks code is in a snippet called Dittotest. I call it on my template - [!Dittotest?!]
My placeholders are in a chunk ’Dittosearch’
When called it returns 0 of 0 articles
If I just call Ditto from inside the snippet as follows:
<?php
/*
BuildGlossary_post - this snippet runs Ditto with glossaryFilter in default mode
Released under the terms of General Public License
Copyright (c) 2010 Aleksander Maksymiuk, http://setpro.pl/software/ditto-stuff/glossary-extender
*/
# the following array serves for both building the index and validating user's requests
$allowed_req = array(
# 'label-for-button-or-link' => 'actual-value-for-regex-clause',
'0-9' => '0|1|2|3|4|5|6|7|8|9',
'A' => 'A',
'B' => 'B',
'C' => 'C',
'D' => 'D',
'E' => 'E',
'F' => 'F',
'G' => 'G',
'H' => 'H',
'I' => 'I',
'J' => 'J',
'K' => 'K',
'L' => 'L',
'M' => 'M',
'N' => 'N',
'O' => 'O',
'P' => 'P',
'Q' => 'Q',
'R' => 'R',
'S' => 'S',
'T' => 'T',
'U' => 'U',
'V' => 'V',
'W' => 'W',
'X' => 'X',
'Y' => 'Y',
'Z' => 'Z',
'ALL' => 'A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z',
);
# validate user's request
$cur_filter = isset($_POST['filter']) && isset($allowed_req[$_POST['filter']]) && $allowed_req[$_POST['filter']] ? $allowed_req[$_POST['filter']] : '';
# build index
$index = '<form method="post" action="[~[*id*]~]" style="margin: 15px 0 15px 0; padding: 0 20px 0 40px;">';
foreach ($allowed_req as $label => $request) {
if ($request) {
$index .= '<input type="submit" name="filter" value="' . $label . '"' . ($request == $cur_filter ? ' disabled="disabled"' : '') . ' />' . ' ';
}
}
$index .= '<input type="submit" name="clear" value="Clear Listing" />' .
'</form>';
# generate output
return $index . ($cur_filter ?
# valid request encountered - build document listing with extended Ditto (default extender mode)
'[[Ditto? &parents=`70,80` &extenders=`glossaryFilter` &hideFolders=`1` &depth=`3` &display=`20` &orderBy=`pagetitle ASC` &filterBy=`' . $cur_filter . '` &tpl=`Dittosearch` &forceUTF8=`1` &paginate=`1` &tplPaginatePage=`pageSplitter` &tplPaginateCurrentPage=`currentPageSplitter`]]' :
# empty, "clear", or invalid request encountered - do not generate anything
''
);
?>
I get articles returned but pagination breaks. Page 1 is fine, but page 2 returns 0 articles