Sonataadminbundle: How to get image preview in symfony collection images

Created on 1 Jul 2014  路  3Comments  路  Source: sonata-project/SonataAdminBundle

In my Admin class :

  class ApartmentsAdmin extends Admin
  {
   protected function configureFormFields(FormMapper $formMapper)
    {
           ->add('images', 'collection', array(
                    'type' => new ImageType(),
                    'allow_add' => true,
                    'allow_delete' => true,
                    'by_reference' => true,
                    'mapped' => true,
                    'label' => false,
                    'required' => false,
                    'label' => 'Apartment Images'
                  ))
           }
      }

It works fine ; but my issue is that , on edit page i want to let see preview of each images included in collection . In documentation of "SonataAdminBundle" image preview is given for one individual image , but how is it possible to make preview for collection images ..

Please suggest me..

Thanks a lot ..

Most helpful comment

All 3 comments

Finally i am able to do this through "custom Form Type Extension" for which documentation is given on the link "http://symfony.com/doc/current/cookbook/form/create_form_type_extension.html" .

@blaues0cke : would you be willing to contribute it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aglemakinafr picture aglemakinafr  路  4Comments

leonboot picture leonboot  路  4Comments

Baltazar5000 picture Baltazar5000  路  3Comments

thomas2411 picture thomas2411  路  4Comments

SlimenTN picture SlimenTN  路  3Comments