Uploaded image for project: 'Content Types'
  1. Content Types
  2. MGNLCT-67

Too hard to configure asset reference with CT

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 1.0
    • None
    • None

    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.

       

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                czimmermann Christopher Zimmermann
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD