Dynamic Media Component: Loss of Custom Fields After Media Addition | Community
Skip to main content
imadullakhan
Level 3
October 23, 2024
Solved

Dynamic Media Component: Loss of Custom Fields After Media Addition

  • October 23, 2024
  • 2 replies
  • 487 views

Hi Everyone,

 

I created a dynamic component in my project by inheriting from dam/components/scene7/dynamicmedia using sling:resourceSuperType to utilize the core functionality of the Dynamic Media component. Initially, everything worked as expected; I added custom fields to the dialog, and after dragging and dropping the Dynamic Media component onto my page, I could see the dialog changes reflecting these custom fields. The resource type correctly pointed to my component (projectName/components/dynamicmedia).

 

However, after adding an image or video to the Dynamic Media component, I encountered an issue: my custom fields disappeared from the dialog, and the resource type reverted to /libs/dam/components/scene7/dynamicmedia. As a result, I lost my custom fields, and the component began pointing to the core component from which I originally inherited.

Could you please help me resolve this issue?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SureshDhulipudi

can you please provide the .content.xml details

Wrapper Component Definition (ui.apps/src/main/content/jcr_root/apps/projectName/components/dynamicmedia/.content.xml)

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Custom Dynamic Media"
sling:resourceSuperType="dam/components/scene7/dynamicmedia"
componentGroup="Custom Components"/>

2 replies

SureshDhulipudi
Community Advisor
SureshDhulipudiCommunity AdvisorAccepted solution
Community Advisor
October 24, 2024

can you please provide the .content.xml details

Wrapper Component Definition (ui.apps/src/main/content/jcr_root/apps/projectName/components/dynamicmedia/.content.xml)

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Custom Dynamic Media"
sling:resourceSuperType="dam/components/scene7/dynamicmedia"
componentGroup="Custom Components"/>

kautuk_sahni
Community Manager
Community Manager
November 5, 2024

@imadullakhan Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni