Results 1 to 3 of 3

Thread: Select in BE

  1. #1

    Default Select in BE

    When defining a select in the BE with options attribute + filter=true, i've got following problem:

    When you see the filter dropdown in the BE, instead of seeing the options, you see the keys to the options.

    Is there a way to display the text insteaad of the keys in the filter dropdown.

    thx

  2. #2

    Default Re: Select in BE

    OK, found myself:

    I had to define options like this:
    'options' => array('Nieuwe boeking in aanmaak' => 'Nieuwe boeking in aanmaak','Nieuwe boeking' => 'Nieuwe boeking','Boeking geaccepteerd' =>'Boeking geaccepteerd','Betaling OK' => 'Betaling OK', 'Overboeking' => 'Overboeking'),

    instead of

    'options' => array('Nieuwe boeking in aanmaak' ,'Nieuwe boeking','Boeking geaccepteerd' ,'Betaling OK', 'Overboeking'),

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Select in BE

    That's because you didn't implement the options correctly. The array must only contain the key values that are stored in the database, you have to use the "reference" array to provide the language strings for the labels, or you have to use an options_callback to do it.

    Read the developer's guide or look at the Contao modules and how they were implemented, before posting basic newbie messages like this?

    DCA
    Code:
    options => array('date_asc', 'date_desc','meta','rand');
    reference => &$GLOBALS['LANG']['tl_xxxx'];
    LANG: languages/en/tl_xxxx.php
    Code:
    $GLOBALS['LANG']['tl_xxxx']['date_asc'] = 'Date ascending';
    $GLOBALS['LANG']['tl_xxxx']['date_desc'] = 'Date descending';
    $GLOBALS['LANG']['tl_xxxx']['meta'] = 'Meta (meta.txt)';
    $GLOBALS['LANG']['tl_xxxx']['rand'] = 'Random';

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •