Problem/Motivation
my question is this: if i create a content type that has a 'media' field (with bundle type 'image'), and then try to use that content type in a Diba Carousel block, the 'Image field' dropdown in 'Slide fields' is empty, ie: it isn't showing my media field.
i then created a standard 'image' field on my content type, and sure enough, that one was visible in the dropdown, and worked as expected.
Steps to reproduce
- set up a content type with a field of type 'media', subtype/bundle 'image'
- try binding a Diba Carousel block's "Image field" (ie: should be a field from the entity type to use for each slide) to that media field. you can't! it won't be listed in the dropdown. it looks like only fields of type 'image' are listed.
Proposed resolution
i am still too new to D9 to propose how to fix, but i can get you started in the right direction ;-) in /modules/contrib/diba_carousel/src/Plugin/Block/DibaCarousel.php go to line 397, in version 2.0.0 the code says:
'#options' => $this->getFieldsByType(['image'], $config['entity_selected']),
i actually tried changing this to
'#options' => $this->getFieldsByType(['media'], $config['entity_selected']),
or
'#options' => $this->getFieldsByType(['media.type.image'], $config['entity_selected']),
and neither of those made any difference, the dropdown was still empty.
i assume there are some other complications at work here? it's over my head.
Comments
Comment #2
earthangelconsulting commentedComment #3
oriol_e9gSupporting media images is a feature request that has not yet been developed. Maybe I will probably develop it in a few months.
Comment #4
earthangelconsulting commentedthat's awesome, oriol_eg9, i am glad to hear that it's on the list !
this is a great module, by the way :-) :-) absolutely does the trick!
Comment #5
oriol_e9gComment #7
oriol_e9g