Add additional filed to assets, in "edit asset" view

Is there a way to add additional fields on each assets, from edit asset view, not in collection or singleton ?

It would be great to not have to créate a new collection only for add informations to asset.

[edit] I found this response who explain how to add some new meta field to global assets.

Now I need to link this asset to a collection. How can I write this?

<div class="uk-form-row">
  <label class="uk-text-small uk-text-bold">{ App.i18n.get('Category') }</label>
  ...
</div>

<div class="uk-form-row">
    <label class="uk-text-small uk-text-bold">{ App.i18n.get('Category') }</label>
    <field-collectionlink link="pages" display="title" multiple="true" bind="asset.category"></field-collectionlink>
</div>

You can pass the options as html attributes, so link="pages" is your linked collection. bind="asset.category" means, that the data is available as $asset['category'].

If you want to get rid of the line, that goes outside the field, you have to remove the class uk-panel-space from the parent container:

The screenshot is in German, but it should be self-explanatory.

2 Likes

Thanks it’s working as expected :slight_smile: