[TYPO3-dev] TCA question: problem sorting select box in frontend

Bart Gijswijt iamzero0 at gmail.com
Fri May 28 22:58:07 CEST 2010


Well yes, I created the extension to extend srfeuserregister. This is in the
ext_tables.php in my extension:

    'myfield' => array (
        'exclude' => 0,
        'label' => 'LLL:EXT:spb/locallang_db.xml:fe_users.myfield',
        'config' => array (
            'type' => 'select',
            'items' => array (
                array('',0),
            ),
            'foreign_table' => 'profiles',
            'foreign_table_where' => 'AND types=1 ORDER BY profiles.name',

            'size' => 1,
            'minitems' => 0,
            'maxitems' => 1,
        )
    ),


This works perfectly in the backend: when editing a frontend user, a select
box appears with all items from profiles where types=1 and ordered by name.

In the frontend (when a frontend user edits his or her account), the same
items appear but ordered by uid. So somehow type=1 is taken into account but
order by name is neglected.
How can I make sure ###TCA_INPUT_myfield### is handled correctly in the
frontend?


2010/5/28 JoH asenau <info at cybercraft.de>

> >>> In ext_tables.php of my extension I edited 'foreign_table_where' for
> >>> my custom fields, to order them in the desired way. This works
> >>> perfectly in the backend, but when I add the select box to a page in
> >>> the frontend, all items are sorted by uid.
> >>>
> >>> How can I change the order in the frontend?
> >>
> >> It depends: How do you "add the select box to a page in the
> >> frontend"?
> >
> > Like this:
> >
> > <!-- ###SUB_INCLUDED_FIELD_myfield### -->
> > <dt><label for="tx-srfeuserregister-pi1-myfield">Select:</label></dt>
> > <dd>
> > <!-- ###SUB_ERROR_FIELD_myfield### -->
> > <p
> > class="tx-srfeuserregister-pi1-error">###EVAL_ERROR_FIELD_myfield###</p>
> > <!-- ###SUB_ERROR_FIELD_myfield### --> <!--
> > ###SUB_REQUIRED_FIELD_myfield### --> <p
> > class="tx-srfeuserregister-pi1-error">###MISSING_myfield###</p> <!--
> > ###SUB_REQUIRED_FIELD_myfield### --> ###TCA_INPUT_myfield###
> > </dd>
> > <!-- ###SUB_INCLUDED_FIELD_myfield### -->
>
> Well - this doesn't look like "your" extension but like srfeuserregister.
> So I guess it depends on how the pi1 is handling ###TCA_INPUT_myfield###.
> If there is no foreign_table_where you will have to do something on your
> own.
>
> HTH
>
> Joey
>
> --
> Wenn man keine Ahnung hat: Einfach mal Fresse halten!
> (If you have no clues: simply shut your gob sometimes!)
> Dieter Nuhr, German comedian
> Xing: http://contact.cybercraft.de
> Twitter: http://twitter.com/bunnyfield
> TYPO3 cookbook (2nd edition): http://www.typo3experts.com
>
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>




More information about the TYPO3-dev mailing list