symfony-cmf/block-bundle

filter should be set on a slideshow

lsmith77 opened this issue · 4 comments

the imagine filter has to be set on the image. this is obviously quite flexible but makes administration needlessly hard. ideally one could set a default filter for a given slideshow on the slideshow itself.

dbu commented

i think the reason why we did not do that right away was because the slideshow could also have other things. but imo having an imagineFilter field should be fine, other blocks will simply ignore that.

the filter should be optional, selected from a dropdown that is configured through bundle configuration with a list of filter system names and filter display names. if the configuration is empty, no dropdown should be shown at all imho.

i will take this one to make my first try for a PR.
only for my head:
add filter property to the SlideshowModel (maybe with a validation for existing/declared filter?)
add a dropdown list to the formMapper in the controller if there are filter declared
add a label/display property to the filter config (locale depending?)

dbu commented

add a label/display property to the filter config (locale depending?)

the filter will not depend on locale, but the sonata admin label should
be in the translation file (sonata automatically puts label.field_filter
or something, check the other forms and translations)

one more step will be to inherit the filter name to the imagine blocks
when rendering. i wonder if we can only do it if the imagine blocks
themselves have no explicit filter, to allow overriding...

Is there a way to extend/append the existing imagine filter setting? By this i would prefer a own setting for the SlideshowBlock.