[Typo3-dev] feature-patch for pi_list_browseresults

Michael H.E. Roth mher at mher.de
Wed Nov 3 17:43:52 CET 2004


Rainer Kuhn wrote:

> 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. 
maybe I should change the name? But to what?

> 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>
> 
Well, I could add these alpha-values to the possible integer values:
'R' would translate into 1
'C' would translate into ceil(($maxPages-1)/2)
'L' would translate into $maxPages-2

<snip desc="discussion of Example 2 of previous post" /> 

<snip desc="discussion and example of the intented interpretation of the
$wrapArr - parameter" />

> 
> 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.
This is the currently intendet behaviour: see doc in previous post
(29.10.04 14:22) and source-code:
>>>if the element ['showResultsNumbersWrap'] is not set, the
>>>LocalLang-String
>>>'pi_list_browseresults_displays' is expected to be in the
>>>"traditional"-format.
>>>if it is set the localLang-String 'pi_list_browseresults_displays' is
>>>expected to contain the template markers ###from###, ###to### and
>>>###outof### (lowest shown record, highest shown record, total number of
>>>records).

maybe I should introduce another marker: ###fromto### so you also can wrap
the whole range: like <...>1 to 5</...> and not only each number by itself.

> 
> 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.

good idea, how should we control this: via
$this->internal['dontLinkCurrentPage'] or via an extra parameter function
pi_link_browseresult (... , $dontLinkCurrentPage=0) ?

Michael
-- 
Michael H.E. Roth




More information about the TYPO3-dev mailing list