core-bundle
core-bundle copied to clipboard
Image attributes partial override
Is it possible to override only one of the needed attributes (set in the "Dateiverwaltung", var = default_image_meta) in the image ("Metadaten überschreiben")? I suggest to show default_image_meta every time "Metadaten überschreiben" is needed.
What exactly do you mean by "default_image_meta"?
when you upload an image, you can set values for alt, caption, title, etc. -> default_image_meta (or default_image_attributes?).
Would such an option fit your needs?
Also the meta data from tl_files should be shown in an extra DIV.
"Fallback when empty" would be great! So the default behavior is overwrite all meta data from file system and if checked "Fallback when empty" only filled data will be overwrited.
perfect!
We have made huge efforts to decrease the number of input fields when adding images in Contao 4.4 (see https://github.com/contao/core/issues/7774), therefore I'm against adding another checkbox.
Can we just show existing values in the corresponding inputs as value="Default value"?
@leofeyer So we have to put the logic into our templates or write an extension.
Maybe the initial idea from #964 is a good compromise? The tickets seem related anyway.
a technique i use in my open graph extension is to use context dependant insert tags. the default values of the fields would change to something like {{image::caption}} for the caption field. This means "use the previously known caption of the current image" (e.g. the value from the filesystem metadata). If you want to overwrite the caption to be empty, you would just delete the prefilled insert tag.
This would be perfect for developers (who LOVE insert tags), but I expect another weird look from our customers (who don't).
Anyway, any news here (or related: #964) how we could proceed?
I still prefer this solution https://github.com/contao/core-bundle/issues/1409#issuecomment-487579931
Fallback when empty. The checkbox Overwrite if empty is not necessary if this is the default behaviour, which I recommend.
Whith this solution you can
- suppress all fields
- suppress one or more fields
- change all fields
- change one or more fields
- still take advantag from the files meta data if you want to
Consider those CE fields as alternative meta data belonging to only this CE, not to the file itself. The checkbox then is the instruction how to handle empty fields.
What you can not do in one CE is e.g.
- change Alternate text
- suppress Image title
- take Image caption from meta data
So one change, one suppress and one fallback is not possible at the same time (CE).
Prefilling the fields from meta data is dangerous because once done those values are saved in CE dataset. This will not change if meta data changes.