[TYPO3-project-formidable] FORMidable custom pager

Manuel Rego Casasnovas mrego at igalia.com
Wed May 23 13:28:26 CEST 2007


Hi everyone.

I'd like to do a custom pager for my FORMidable list.

I've set the value for the tag /nav/window to 3.

And my template is the next:
<div class="pagination">

<!-- ###LINKPREV### begin--><a href = "{link}">previous</a> |<!--
###LINKPREV### end-->

<!-- ###LINKFIRST### begin--><a href = "{link}">1</a> |<!--
###LINKFIRST### end-->

<!-- ###WINDOW### begin-->
    ... |
    <!-- ###WINDOWLINKS### begin-->
        <!-- ###NORMAL### begin--><a href = "{link}">{page}</a> | <!--
###NORMAL### end-->
        <!-- ###ACTIVE### begin-->{page} |<!-- ###ACTIVE### end-->
    <!-- ###WINDOWLINKS### end-->
    ... |
<!-- ###WINDOW### end-->

<!-- ###LINKLAST### begin--><a href = "{link}"><!-- ###PAGER###
begin-->{pagemax}<!-- ###PAGER### end--></a> |<!-- ###LINKLAST### end-->

<!-- ###LINKNEXT### begin--><a href = "{link}">next</a><!--
###LINKNEXT### end-->

</div>


I use the code from last SVN revision in the dhlister, the code for
current 0.7 version have problems with the links:
------------------------
$iStart = $iPage - $iWindow;
if($iStart < 0) {
        $iStart = 0;
}

$iEnd = $iPage + 1;
if($iEnd > $iPageMax) {
        $iEnd = $iPageMax;
}

for($k = $iStart; $k <= $iEnd; $k++) {
        $aWindow[($k + 1)] =
"javascript:void(Formidable.Lister.Pager.goTo('" . $sFormUniqueId . "',
" . $k . "));";
}
------------------------

I've changed the first line, I've put $iWindow instead of 3 (I think
that this is a little bug).

I've get a good pager with this, something like this:
previous | 1 | ... | 3 | 4 | 5 | 6 | 7 | ... | 10 | next

But when I go to the first page, I get the next result:
... | 1 | 2 | 3 | ... | 10 | next

This isn't bad but I'd like that don't show the first ... |, and get
something like:
1 | 2 | 3 | ... | 10 | next

I don't know exactly how to work the tag ###WINDOW### and ###WINDOWLINKS###.

Somebody has done a custom pager similar before?


Thank you very much,
   Rego

--
http://www.igalia.com


More information about the TYPO3-project-formidable mailing list