core-bundle
                                
                                 core-bundle copied to clipboard
                                
                                    core-bundle copied to clipboard
                            
                            
                            
                        Pre-fill the meta data overwrite fields
referring to https://github.com/contao/core-bundle/pull/807
You implemented the new button "override Metadata", which is a great progress. But: If we click on this "override Metadata", all the fields are empty at first.
For customers and editors, it would be great if the (already in the file-manager defined) Metadata would be inserted automatically, so that they can change/adjust it easily instead of having to insert everything from scratch.
Could it be made that when choosing a image (or: enabling "override Metadata"), the Metadata defined in the file-manager is fetched and inserted, so that the fields for the manual override are prefilled and can simply be changed?
Second thought: If clicking on "override Metadata" and all the meta-fields are empty, it should fetch the Metadata from the file-manager.
This is the case if you click on the "override Metadata" for the first time (good!), or when you empty all fields, uncheck "override Metadata" and then check it again (this would reset the Metadata to the Filesystem and would allow further changes.
The only disadvantage would be if you don't want to have any image-Metadata. When you empty all fields, uncheck and recheck "override Metadata", you would have to empty the fields again. But why should you want do do this? It doesn't seem like a large drawback to me.
Could it be made that when choosing a image (or: enabling "override Metadata"), the Metadata defined in the file-manager is fetched and inserted, so that the fields for the manual override are prefilled and can simply be changed?
Question would be wich language to choose. In the Filemanager you can add any language where in the override-setting it would be suitable to choose the site-root-language which might not be the default-language nor the user/BE-language of the editor.
True. But what language would use an editor, if he/she would manually override the Metadata? Do you believe, he/she would use lng-Inserttags? Using the default language should be safe enough for most cases.
To complete this thought, the Option "override Metadata" should offer the possibility to select multiple languages - as it is in the file-manager. Only then the option "override Metadata" - and your comment - would make real sense.
I have various scenarios where the BE-language of the user does not match the language of the content they are editing.
To complete this thought, the Option "override Metadata" should offer the possibility to select multiple languages
I disagree because the ContentElement already belongs to a site-root which determines the FE-Language. The new Filepicker (how i understand) will allow to change/add Metadata in various languages directly to the file and on-the-fly - which is something i appreciate. So the "override Metadata" would only be needed in rare occasions.
True, the editing method over the filepicker is very convenient.
But if you use an image several times and want different captions (because you use it together with different texts and would like to have a suitable caption) while retaining the title text and especially the alternative text for the image, it would be great if the "meta data overwrite fields" would be prefilled.
I do not like this idea with prefill.
At present we have 4 metadata - title, alt, link and caption.
These data are fixed to a file stored in tl_files.meta.
If a BE object, e.g. tl_content, would like to offer the possibility to overwrite this data once, then there is IMHO only one solution:
There should be 4 fields in tl_content (or one as in tl_files.meta) that correspond to the 4 metafields.
Tl_content checks before editing the template whether one of these fields has a content and if so, this content is taken instead of the corresponding field in tl_files.meta.
Not more. Indeed it would be helpful if you would see the "fallback" values from tl_files.meta at the very right moment you like to enter a value into one of these 4 fields. Multi language would be nice.
Could you insert the "fallback"-values from tl_files.meta as a input-placeholder? And if you choose to override the metadata, you could just type in your new text. If you type nothing, the standard metadata from tl_files.meta is used.
But what if you want to erase the metadata? Let's say, you don't want to display a title, but in tl_meta a title is set. How would you accomplish that?
This can look likes this.
By default "Overwrite meta data" is not checked and you have a preview of the meta data.

If you like to overwrite then you check "Overwrite meta data" and leave the fields empty.

Such simple.
Here's the HTML
<div class="meta_data">
  <h3>Meta data</h3>
  <table>
    <caption>German</caption>
    <tbody>
      <tr>
        <th>Title</th>
        <td>Titel von DSC_5276</td>
      </tr>
      <tr>
        <th>Alternate text</th>
        <td>Alt von DSC_5276</td>
      </tr>
      <tr>
        <th>Link</th>
        <td>https://contao.org/de/</td>
      </tr>
      <tr>
        <th>Caption</th>
        <td>Unterschrift von DSC_5276</td>
      </tr>
    </tbody>
  </table>
  <table>
    <caption>English - English</caption>
    <tbody>
      <tr>
        <th>Title</th>
        <td>Title of DSC_5276</td>
      </tr>
      <tr>
        <th>Alternate text</th>
        <td>Alt of DSC_5276</td>
      </tr>
      <tr>
        <th>Link</th>
        <td>https://contao.org/en/</td>
      </tr>
      <tr>
        <th>Caption</th>
        <td>Caption of DSC_5276</td>
      </tr>
    </tbody>
  </table>
</div>
Ok, the meta language was another than the FE language. So please ignore this single post.
Now I have the usecase that the template ce_image outputs no meta data. But meta data title, alternate text, link and caption definitely exist.
Template output:
Array
(
  [type] => image
  [alt] => 
  [imageTitle] => 
  [imageUrl] => 
  [fullsize] => 1
  [caption] => 
  [target] => 
  [titleText] => 
  [linkTitle] => 
  [metaIgnore] => 
  [customTpl] =>
  [overwriteMeta] => 
)
You can not test this in the online demo. There is no LTS online demo and in 4.5 there are no meta datas with the content-images.
Maybe it depends on the fact that I once enabled "Overwrite meta data" but then disabled it again. This should not happen. If overwriteMeta is not checked it should output meta data from tl_files.
is there something new here? or in #1409?
Gibt es hier schon etwas Neues?