That would be superb. I’m probably some way off being able to tackle the gallery field myself.
I can help point you in the right direction, as none of this stuff is documented yet…
Probably the best way to start is build off an existing field and just create your own UI by using the
field :gallery, :matrix, template: 'my_gallery' do
field :image_id, :asset
field :caption, :string
This way the underlying data structure that the field would expect is an array of hashes, just like how the existing matrix field works, but now you can focus on creating a better UI for a gallery. Later on you can work out whether this needs to be it’s own field type (a class inheriting from
If you need to load your own js/css assets, there is a way of doing this. Somewhere in your application initialisation:
# We can add custom assets to the admin asset pipeline
PushType.admin_assets.stylesheets << 'my_gallery'
# Or do the same in one line...
Give me a shout if you need any help or pointers