私はここで迷子になり、アドバイスが必要です。私の状況:次のコードを使用して、モジュールのデフォルトのアイテム制限を変更します:
<form method="get" style="text-align:center;">
<input type="hidden" name="lastrecepes" value="">
<button type="submit" value="24" id="limit" name="limit" onclick="change();" style="width:200px;margin:20px 0 20px 0;"/>change limit</button>
<script>
function change(){
var elem = document.getElementById("limit");
if (elem.value=="24") elem.value = "36";}
</script>
</form>
helper.php:
public static function getLists(&$params)
{
$total_items = ($_GET['limit']) ? $_GET['limit'] : $params->get('count');
if ($_GET['limit']) $params->set('count',$_GET['limit']);
$content_source = $params->get('content_source','joomla');
}
私のリンクは次のように変更されます:http:* / project /?lastrecepes =&limit = 36そしてそれは機能しますが、私が次のような別のフィルターを追加しようとすると:
<button type="submit" value="0" id="skip_items" name="skip_items" onclick="change1();" style="width:200px;margin:20px 0 20px 0;"/>more</button><script>
function change1(){
var elem = document.getElementById("skip_items");
if (elem.value=="0") elem.value = "15";}
</script>
制限を古い値に変更し、URLは次のようになります:http:* / project /?lastrecepes =&skip_items = 15
それらを手動で追加すると、正常に機能します:http:* / project /?lastrecepes =&limit = 36&skip_items = 15
誰かがそれを手伝ってくれますか、私は別のフィルターが入ったときに最初のフィルター結果を保存したいと思います。