私のカスタム テンプレート tpl ファイルでは、カスタム モジュールの各関数から 1 つずつ、データの 2 つのセクション (div コンテンツ) を表示しています。データには、下に表示されているページネーションもあります。
最初は 1 ブロックのデータのみが表示されます。ユーザーがページ内のタブをクリックしない限り、他のデータ ブロックはページ上で非表示になります。私の質問は、同じページ内のブロックごとに個別のページネーションを表示するにはどうすればよいですか?
ブロック 1 のページ リンクをクリックしてそのページに移動した場合、別のブロックのページネーション リンクが影響を受けてはなりません。Drupal 7 でこれを達成するにはどうすればよいですか?
// my custom module code below
// function one
func one() {
$page = strtolower($page);
$query = db_select('keyword', 'k');
$query->groupBy('k.res');
$stories = $query->extend('PagerDefault')->limit(10)->execute();
return $stories;
}
// function two
func two() {
$page = strtolower($page);
$query = db_select('videos', 'v');
$query->groupBy('v.res');
$videos= $query->extend('PagerDefault')->limit(10)->execute();
return $videos;
}
// in my custom template page // below is first section in same page $block_content = fun one(arg(1)); $args = array( 'parameters' => array('pg' => 'one')); print (theme ('pager',$args)); foreach($block_content as $content) { // doing something to display } print (theme ('pager',$args)); // below is second section in same page $block_content = fun two(arg(1)); $args = array( 'parameters' => array('pg' => 'two')); print (theme ('pager',$args)); foreach($block_content as $content) { // doing something to display } print (theme ('pager',$args));