Custom Pagersのドキュメンテーションページにあるように、Custom Pagers 6.x系(Drupal 6.x用)バージョンではご使用のテーマのディレクトリにcustom-pager.tpl.phpファイルをアップロードすることで、Custom Pagersディレクトリのデフォルトのcustom-pager.tpl.phpをオーバーライドすることができます。また、下のような名前のテンプレートをご使用のテーマのディレクトリにアップロードすることによって、Custom PagersのID別、ノードタイプ別、表示位置別、ノードタイプ-表示位置別、Custom PagersのID-表示位置別など、細かくテンプレートを使い分けることができます。
custom-pager-PAGER ID.tpl.php
custom-pager-NODE TYPE.tpl.php
custom-pager-PAGER POSITION.tpl.php
custom-pager-NODE TYPE-PAGER POSITION.tpl.php
custom-pager-PAGER ID-PAGER POSITION.tpl.php
ただし、Custom Pagers 6.x-1.x-dev(2009-Sep-18)では、テーマディレクトリのcustom-pager.tpl.phpの変更は反映してくれるものの、custom-pager-PAGER ID.tpl.phpなどのより細かく分けたテンプレートを読み取ってくれないようです。
Template suggestions fails | drupal.orgを参考にして、$vars['suggestions']を$vars['template_files']とすることで修正できます。具体的にはcustom_pagers.moduleの295行目
$vars['suggestions'][] = "custom-pager-{$vars['position']}";
$vars['suggestions'][] = "custom-pager-$node->type";
$vars['suggestions'][] = "custom-pager-$node->type-{$vars['position']}";
$vars['suggestions'][] = "custom-pager-$pager->pid";
$vars['suggestions'][] = "custom-pager-$pager->pid-{$vars['position']}";
の部分を
$vars['template_files'][] = "custom-pager-{$vars['position']}";
$vars['template_files'][] = "custom-pager-$node->type";
$vars['template_files'][] = "custom-pager-$node->type-{$vars['position']}";
$vars['template_files'][] = "custom-pager-$pager->pid";
$vars['template_files'][] = "custom-pager-$pager->pid-{$vars['position']}";
に変更します。
このときもCustom Pagersで前のノードと次のノードのタイトルを表示と同様に、custom_pagers.moduleに直接変更を加えなくても、ご使用のテーマのtemplate.phpにTHEMENAME_preprocess_custom_pager()としてオーバーライドすることができます。Custom Pagersの次のバージョンではこのバグが修正されていることを願いますが、Custom Pagers 6.x-1.x-dev(2009-Sep-18)を使用していて、テンプレートの細かい使い分けで躓いたらこの方法を試してみてください。
コメントを追加