Skip to content

MWSimple/EasyAdminGalleryBundle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Func/EasyAdminGalleryBundle

Mosaic listing, drag and drop upload and more for EasyAdminBundle

Demo

  • Mosaic / mason listing
  • Drag and drop file upload and create records

install

download repo via composer

composer require funcphp/easyadmin-gallery "dev-master"

enable bundle from app/AppKernel.php

    $bundles = [
        ...
        new Func\EasyAdminGalleryBundle\FuncEasyAdminGalleryBundle(),
        ...
    ];

install assets

php bin/console assets:install --symlink

usage

1.

set your gallery entitiy controller as Func\EasyAdminGalleryBundle\Controller\GalleryController

or

use this trait in your gallery admin controller: Func\EasyAdminGalleryBundle\Controller\Traits\ListMosaic

2.1. mosaic view

easy_admin:
    entities:
        Gallery:
            class: AppBundle\Entity\Gallery # an entity
            controller: Func\EasyAdminGalleryBundle\Controller\GalleryController
            list:
                fields:
                    
                    # thumbnail field
                    -
                        property: 'image'
                        type: 'image'
                        base_path: '%path.gallery%'
                        thumbnail: true ##
                    
                    # thumbnail text field
                    -
                        property: 'title'
                        thumbnail_text: true ##
                    
                    # other fields
                    - 'id'
                    - 'enabled'
                    
                    ...
                ...
            ...
        ...
    ...
...

ready to mosaic listing.

2.2. drag and drop upload

set your gallery entitiy controller as Func\EasyAdminGalleryBundle\Controller\GalleryController

or

use this trait in your gallery admin controller: Func\EasyAdminGalleryBundle\Controller\Traits\DragDrop

easy_admin:
    entities:
        Gallery:
            class: AppBundle\Entity\Gallery # an entity
            controller: Func\EasyAdminGalleryBundle\Controller\GalleryController
            dragDrop:
            
                #backend values
                values:
                   #column: "value"
                    imageFile: "%%file%%"
                    title: "%%file.name%%"
                    enabled: true
                    description: "This record created by drag'n drop!"
                    
                #frontend values
                fields:
                   #form fields to overwrite values
                    - 'enabled'
                    - 'description'
                    
            list:
                fields:
                    ...
            form:
                fields:
                    ...
                ...
            ...
        ...
    ...
...

ready to drag and drop uploading.

todo list

  • custom list action: mosaic / mason listing
  • custom list action: drag and drop file upload and create records
  • custom show action: gallery viewing - prev / curr / next
  • custom edit action: drag and drop

About

Mosaic listing, drag and drop upload and more for EasyAdminBundle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 28.4%
  • JavaScript 27.2%
  • CSS 24.9%
  • PHP 19.5%