[TYPO3-project-formidable] Formidable questions

Manuel Rego Casasnovas mrego at igalia.com
Wed Jul 23 07:35:02 CEST 2008


Hello,

Some quick answers:

> 
> 2) SORT:
> I would like to sort my lister at the first display on one of my database field. Fox example, fe_users table.
> So, I have add an ORDER BY in my sql:
> <datasource:DB name="fe_users">
>   <sql><![CDATA[
>     SELECT
>       fe_users.username AS username
>     FROM
>       fe_users 
>     WHERE 1
>     ORDER BY fe_users.username
>   ]]></sql>
> </datasource:DB>
> And it works. But the problem is that if I sort my lister by clicking on the column I have and
> sql error because my request looks like this:
> SELECT SQL_CALC_FOUND_ROWS 
>   fe_users.username AS username
> FROM
>   fe_users 
> WHERE 1
> ORDER BY fe_users.username
> ORDER BY  username ASC  LIMIT 0, 20
> How can I do ?

You can use something like:
<renderlet:LISTER ...>
   ...
   <pager>
      <sort column="username" direction="desc" />
   </pager>
</renderlet:LISTER>

See an example at:
http://formidable.typo3.ug/pastebin/snippet/45.html

> 
> 3) RENDERLET DATE:
> In my renderlet lister I want to display the starttime field of the table fe_users.
> So I have done:
> <column name="starttime" type="renderlet:DATE" listHeader="Date" label="Date" sort="true">
>   <data>  
>     <datetime format="%d %B %Y" />  
>   </data>  
> </column>
> But it's not written like "DD/MM/AAAA" but "1216211380" (for example).
> What's the problem in my code ?

It works for me with table pages, my XML is:
<column name="crdate" type="renderlet:DATE" listHeader="crdate">
   <data>
      <datetime format="%d %B %Y" />
   </data>
</column>

I don't find any problem in your code.


Best regards,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com


More information about the TYPO3-project-formidable mailing list