[TYPO3] kickstarter orderby date
Tim Boesenkool
boesenkool at gmail.com
Mon Jul 31 17:33:58 CEST 2006
Bernard
That was the fix I've been looking for!. BTW the extra // inf front of
$this->internal['orderByList']='file_date'; in my code, was just some
residual from tinkering. I did know it had to be removed.
Regards and very BIG thanks!
Tim
On 7/31/06, Bernhard Kraft <kraftb at kraftb.at> wrote:
> Tim Boesenkool wrote:
>
> > I have modified everything else I need, and I can get the column heads
> > to sort correctly when clicked, but I can't get the initial page to
> > load correctly after a new record is added. It always defaults to the
> > bottom of the list.
>
> I can't believe you can sort the list anyhow when you have this line commented
> out:
>
> > // $this->internal['orderByList']='file_date';
>
> You should set "orderByList" to a comma separated list of all fields for which you would like
> to allow sorting ...
>
> And here:
>
> > // Initializing the query parameters:
> > list($this->internal['orderBy'],$this->internal['descFlag']) = explode(':',$this->piVars['sort']);
>
> it get's initalized after which field to sort ... $this->piVars['sort'] will contain a string like:
> "title:1" which means that it should get sorted after the title field DESCending .... but this will
> only happen if you hvae "orderByList" set to "whateverfield,title,whateverfield2" .... meaning title
> must occur in the orderByList.
>
> The problem when you view the page for the first time is that $this->piVars['sort'] is not intialized.
>
> The easiest thing is to initalize it directly via the $this->piVars['sort'] variable. So just add the
> lines:
>
> if (!isset($this->piVars['sort'])) {
> $this->piVars['sort'] = 'myDefaultOrderField:1'; // 1== Descending, 0 == ascending
> }
>
> before the line:
>
> > list($this->internal['orderBy'],$this->internal['descFlag']) = explode(':',$this->piVars['sort']);
>
>
>
> greets,
> Bernhard
> --
> ----------------------------------------------------------------------
> "Freiheit ist immer auch die Freiheit des Andersdenkenden"
> Rosa Luxemburg, 1871 - 1919
> ----------------------------------------------------------------------
> [[ http://think-open.at | Open source company ]]
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
More information about the TYPO3-english
mailing list