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?
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
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);
Comments
$fields['show_image']['ignore_representative'] = TRUE;
http://docs.getfuelcms.com/general/forms#representatives
That is a very cool feature. Thanks!
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);