[Typo3] Sorting problem in my own extension

Christian Trabold trabold at mehrwert.de
Thu Aug 11 15:33:27 CEST 2005


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?


Regards,

Christian



More information about the TYPO3-english mailing list