[MGNLCT-67] Too hard to configure asset reference with CT Created: 10/Sep/18  Updated: 10/Dec/18  Resolved: 10/Dec/18

Status: Closed
Project: Content Types
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Critical
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Content types Developer Preview

 Description   

It must be possible to create an asset reference as a property in a content type by only providing simple configuration in a CT model definition.

Currently it is quite complicated - one must:

  1. Retrofit the assets app as a CT-based app.
    • Create a minimal CT for the assets workspace. 
    • Decorate the Assets app to add a "contentType" field and change the class.
  2. Define a property with type "Asset" on your custom content type.
  3. Provide almost the full field configuration in the app file in order to have the asset link stored properly and also to have a proper preview. (See config sample below)
              image:
                targetWorkspace: dam
                identifierToPathConverter:
                  class: info.magnolia.dam.app.assets.field.translator.AssetCompositeIdKeyTranslator
                contentPreviewDefinition:
                  contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent

 

Developer should only have to perform step 2 in the above list.

 



 Comments   
Comment by Oanh Thai Hoang [ 20/Sep/18 ]

One temporary solution (kind of introducing "Asset" type ) has been push to PR of MGNLUI-4619. If it is approved, "Developer only have to perform step 2 in the above list" 

Comment by Christopher Zimmermann [ 20/Sep/18 ]

Really cool! I commented on the PR.

Comment by Mikaël Geljić [ 10/Dec/18 ]

Supported in 1.0 as a model property with type: asset
—via https://documentation.magnolia-cms.com/display/DOCS60/Content+type+Model+definition#ContenttypeModeldefinition-anc-property-definition-propertiesPropertydefinitionproperties

Generated at Mon Feb 12 00:36:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.