If the field name ends with "image" or "img" then FUEL will automatically create both a file upload and image select field for that field. You can overwrite that in your form_fields method though. The key to getting the asset select window is to add the class "asset_select" followed by the folder name (if it isn't the "images" folder). Below is a link to a list of special CSS classes you can add to your fields that will give them some extra functionality.
How can I set more that one class? tried "select_assets,multifile" also array('select_assets', 'multifile') but it didnt work. Also, Ive tried setting a field type as multifile but in database I only see the first selected file. Do I have to use on_after_save to parse the array of files manually? Thanks!
For multiple classes try "multifile select_assets" (order matters). The "select_assets" class can pass a second class argument as the folder you want to select from (e.g. "select_assets images") so "select_assets multifile" would actually be that argument for the select assets so it's best to switch it.
With regards to your second question, yes, you will need to use on_after_save to handle the files.
Comments
http://www.getfuelcms.com/user_guide/modules/forms
Also, Ive tried setting a field type as multifile but in database I only see the first selected file. Do I have to use on_after_save to parse the array of files manually?
Thanks!
With regards to your second question, yes, you will need to use on_after_save to handle the files.
The column in the database is called 'promo_asset'. In my form_fields() function I have: The asset field is still only letting me select images
Also, is there a way to change the text on the "Select Image" button to "Select pdf" or will this happen when I get the field setup correctly?
Thanks,
Greg
$fields['promo_asset']['folder'] = 'pdf';
The folder must also be writable.