Did you have any particular reason to provide a field formatter instead of extending the core default image behavior?

See:
\Drupal\image\Plugin\Field\FieldType\ImageItem

Using a formatter works only in the frontend but can't display a default image in the form or be used in a base field definition.
Thanks for considering an extension in that direction.

Comments

marcusx created an issue. See original summary.

marcusx’s picture

Title: Overwrite FieldType instead of formater » Overwrite FieldType instead of formatter

Typo

gaëlg’s picture

I did not think on it much, but it seemed more logical to me to handle this at the display level, because it's actually not a default value for the field, it's a default display if the field as no value. We could have a different default image on teaser and full display, or even have no default image on full display, for example (only display an image if a real one is provided). And also, I found it more easy to do like this. I don't have to handle the image styles.

But I agree that this might not be perfect in a UX perspective. If you want to try to implement the other way to do, I'm open to it. I won't spend much time on it though, because this module just fills my basic needs currently.

gaëlg’s picture

Status: Active » Needs work

For the image styles part, there's a separate issue: #2973564: Apply the image style to the default image

ivnish’s picture

Status: Needs work » Active

"Needs work" for not working patches. No patch in this issue, status may be "Active"

gaëlg’s picture

Status: Active » Closed (outdated)