[Typo3] Sorting problem in my own extension
Piotr Burda
pburda at narty.pl
Fri Aug 12 10:00:08 CEST 2005
Christian Trabold napisał(a):
> Hello Piotr,
>
>> I wrote a simple adress list extension.
>> It works fine, but i can`t sort by town
>>
>> some lines from extension :
>> // Initializing the query parameters:
>>
>> list($this->internal["orderBy"],$this->internal["descFlag"]) =
>> explode(":",$this->piVars["sort"]);
>>
>> $this->internal["results_at_a_time"]=t3lib_div::intInRange($lConf["results_at_a_time"],0,1000,20);
>> // Number of results to show in a listing.
>>
>> $this->internal["maxPages"]=t3lib_div::intInRange($lConf["maxPages"],0,1000,2);;
>> // The maximum number of "pages" in the browse-box:
>> "Page 1", "Page 2", etc.
>>
>> $this->internal["searchFieldList"]="name,zip,town,street,phone,contact,branch,province,www,email";
>>
>> $this->internal["orderByList"]="uid";
>>
>>
>> i changed uid to town in last line but it doesn't work too.
>>
>> Where is the problem?
>
>
> With "orderByList" you enable fields for sorting.
>
> With "orderBy" you can sort by the desired field, IF it is in
> "orderByList".
>
> So you'll have to do this:
>
> $this->internal["orderByList"]="town";
> $this->internal["orderBy"]="town";
>
>
> Is it clearer now?
>
Thanks Christian, it works
Piotr
More information about the TYPO3-english
mailing list