New version by Mark http://modxcms.com/Results-Per-Page-1574.html
Thanks Mark to allow doing this so easy !
This small tips allow the user to select how many result are displayed on the page.
It can be modified to add other choice, date asc, desc ...
First: you must call Ditto with the parameter : &extenders=`request`
Two: add this small snippet and call it just before your ditto call
Note: Requires Ditto 2
Use this code as you want.
Edit (Mark) : There is a new version available
here that supports Ditto’s &id parameter. The previous version by Soda is still available below.
<?php
$choix_res_per_page=array(0,1,2,3,4,5,6,10);// Enter the differents choice you would allow
$default_value=3; // The default choice value
$label_choice='Results per page:'; // The label for the field
$go='Go'; //label for the form's button
$nbres=(isset ($_GET['ditto_summarize']))?$_GET['ditto_summarize'] :$default_value;
echo <<<END
<form method="get">
<label for="nbres">$label_choice</label>
<select name="ditto_summarize" id="ditto_summarize">
END;
foreach ($choix_res_per_page as $value ){
$selectedres=($value==$nbres)?' selected="selected"':'';
echo " <option value=\"$value\"$selectedres>$value</option>\n";
}
echo "</select>";
echo <<<END
<input class="boutton" value="$go" type="submit"></p>
</form>
END;
?>
Example call:
[!ResPerPage!]
[!Ditto? &parent=`29` &extenders=`request` paginate=`1`!]