Problem with form_field

edited May 2015 in Modules
Hi,
I have a simple module based on a table with a field show_image.
The CMS seems to automatically produce an asset form field for this in the create view, although I explicitly wrote
$fields['show_image']['label'] = lang('form_label_mannschaft_show_image'); $fields['show_image']['type'] = 'enum';

How can I achieve that the field is displayed as enum?

Comments

  • edited 6:15PM
    Because it has "_image" in the field name, it will detect it using a representative. To ignore the representative, add the following:
    $fields['show_image']['ignore_representative'] = TRUE;
    http://docs.getfuelcms.com/general/forms#representatives
  • edited 6:15PM
    hmm ok... should read the page to the end :-)
    That is a very cool feature. Thanks!
  • edited May 2015
    Hi,
    I have another question according to the representatives.
    I have a db field published. Here the CMS correctly translates the enum values yes and no to the german values ja and nein. In the same table I have an enum field show_beruf. Here the system does not translate the enum values.
    Is there a configuration value to handle this behaviour or do I have to manually overwrite the enum options like in
    $options = array('yes' => 'ja', 'no' => 'nein'); $fields['enum_example'] = array('type' => 'enum', 'mode' => 'radios', 'options' => $options);
  • edited 6:15PM
    You will need to manually overwrite those enum values.
Sign In or Register to comment.