Multiple Images

Hi,
i have set up an 'image' field on 'products' table in a database. Fuel has then added an Image field to upload an image from the create form. The question is how can upload multiple images instead of just one field? Do I have to create a products_to_images table or something similar to tell Fuel to add more than one field?
Thanks in advance!

Comments

  • edited June 2011
    You can add the CSS class 'multiple' to the form field and it will allow you to upload more then one image. You may need to use one of the model hooks like on_after_post() to do any processing of the images.
    // in your models form_fields() method $fields['image']['class'] = 'multifile';
    http://www.getfuelcms.com/user_guide/modules/forms
  • edited 12:33AM
    Great! it worked like a charm.
    Another question :) How can I filter a field for example so it can be stored in db as sha1? And to customize an INSERT so i can tell fuel to store NOW() for the date field?
    Thanks for you support. I love FUEL.
  • edited 12:33AM
    I'd use one of the model hooks like on_before_save() or on_before_validate() on your model:
    http://www.getfuelcms.com/user_guide/libraries/my_model (at the bottom of the page).
  • edited 12:33AM
    shouldnt it be 'multifile' not 'multiple'?
  • edited 12:33AM
    Yes... you are right... I've edited above to correct.
Sign In or Register to comment.