[Typo3-dev] feature-patch for pi_list_browseresults

Rainer Kuhn kuhn at punkt.de
Wed Nov 3 13:19:00 CET 2004


Michael H.E. Roth wrote:
> New Patch now: http://www.mher.de/pi_list_browseresults-3.0.0.patch.gz
> (diff -u ...)

I tried this one now referring to your explanations.

>> > $this->internal['pagefloat']
...
>>Did I misunderstood something or is this _not_ the expected behaviour?
>
> Ooops, I think I found the reason for Example 1, and eliminated it.

After some tries now I understood what $this->internal['pagefloat'] does,
but IMHO it is still a little confusing to use. I would prefer an alignment
option to decide if the page links around the currently active page are
left-aligned, right-aligned or centered withing the range of maxPages;
something like:

$this->internal['pagefloat']
(string 'L', 'R', 'C': alignment of page links within the specified maxPages
range, if not set or another value: "traditional behaviour")

Example:
I have 26 list elements with results_at_a_time = 3 and maxPages=5. When
displaying Page 4 ('results 9 to 12 out of 26')

Using the "traditional behaviour" this results in
<Previous  Page 1  Page 2  Page 3  _Page 4_  Page 5  Next>

Using $this->internal['pagefloat'] = 'C' this could result in
<Previous  Page 2  Page 3  _Page 4_  Page 5  Page 5  Next>

Using $this->internal['pagefloat'] = 'L' this could result in
<Previous  Page 3  _Page 4_  Page 5  Page 5  Page 6  Next>

Using $this->internal['pagefloat'] = 'R' this could result in
<Previous  Page 1  Page 2  Page 3  _Page 4_  Page 5   Next>



>>Example 2: Same configuration as above, but maxPages=10. The "traditional
>>behaviour" displayed the same result as above, and after setting
>>$this->internal['pagefloat'] to 3 nothing changed:
>>
>>Page 1  Page 2  Page 3  Page 4  Page 5  Next >
...
> Example 2 should have shown with or without pagefloat also Page 6
> (ceil(26/5) results in 6, thus showing 0..5 (6 pages)

You're right, this was a fault of mine (copy & paste in my email).


>>Testing the third parameter $wrapArr (also mentioned in the other branch
>>of this thread) resulted sometimes in a "broken" display, e.g. with the
>>following example displaying Page 1: [...]
> 
> This is intended behaviour, because otherwise you couldn't get rid of the
> table layout. If you just want to change some part of the table layout you
> have to keep its essitial markup, in your example:
> $wrapArr['disabledLinkWrap'] = '<td nowrap="nowrap"><div
> style="color:red">|</div></td>
> should do the trick.

OK, I thought about that, but I wasn't sure if this was the intension.


> I think this needs more documentation with some examples.
<snip desc="example for a working setup of $wrapArr" />
> you are always just overwriting the complete wrapper for an element and it
> has to fit into the nested structure of the rest.
> 
> I hope this clarifies some.

Yes, got it. This works fine - except of the line

$wrapArr['showResultsNumbersWrap'] = '<span
class="showResultsNumbersWrap">|</span>';

which results in non-replaced template markers

<div class="showResultsWrap">Displaying results ###SPAN_BEGIN###%s to %s out
of ###SPAN_BEGIN###%s</div>

instead of

<div class="showResultsWrap">Displaying results <span
class="showResultsNumbersWrap">1 to 5</span> out of <span
class="showResultsNumbersWrap">26</span></div>

which it probably should have been.


One last proposal for improvement: maybe an additional parameter to disable
linking of the currently active page link could make sense. IMHO the
"traditional behaviour" of the list browser (linking the currently active
page same as all other page links) is a little irritating.

Cheers,
Rainer






More information about the TYPO3-dev mailing list