/GridFieldGalleryTheme

Gallery view styling and functionalities of SS3 GridField

Primary LanguagePHP

GridField Gallery Theme

SS3 GridField component that attempt to change the GridField layout into an basic gallery view. (Still in dev)

preview

About

Usage

Add component like this:

$config->addComponent(new GridFieldGalleryTheme('HasOneRelation'));

with the string 'HasOneRelation' being the name of the has_one Image/File relation in your DataObject that your want to use as thumbnail/icon preview.

File type icons

File type icons are stored in the component's folder under img/icons/ saved as PNG and name with the extension of the file type (i.e. pdf.png) Although, if no icon file is found for the specific extension, the extension is looked up in $fileTypeMapping to find a suitable icon.

NOTES

  • Tested in Chrome, Safari, FireFox, Opera and IE9
  • GridFieldSortableHeader is removed since this causes problem with the layout (at least for now)

@TODO

  • Add functionality to display a Name/Title on mouseover
  • Option for dynamic thumbnail resizing in the view
  • other stuff...