Questions on Embed Component V2 | Community
Skip to main content
Robert-Harper
Level 3
September 26, 2022
Solved

Questions on Embed Component V2

  • September 26, 2022
  • 1 reply
  • 2275 views

I'm working on implementing the Embed V2 component. I want to add a new embedded component to implement Spotify. I've copied the YouTube component and changed the field names in the dialog. I'm having issues with getting things to show properly. 

 

I have the YouTube and Spotify components under the /apps/acs-commons/components/content/embeddable folder in the JCR. I can see them in the page template's properties for the Embed component. After adding them to the template policy and configuring the settings a default values, I can then add them to a page using the template.

 

Then when I open the Embed dialog to configure which feature I want to embed, I can select "Embeddable" from the radio buttons. Then when I select either YouTube or Spotify, the component properties aren't shown so that I can select the ID for the video/audio or any of the other settings.

 

If I set the sling:resourceSuperType to the V2 version of the Embed component, nothing shows. I have applied the core.wcm.components.all-2.20.6 update so the Embed V2 should be up to date but it still doesn't seem to work as expected.

 

Ideas on what I can do to fix this?

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 arunpatidar

I figured out what my issue was. There is a much more simple answer to why I was having issues and I found I didn't have to have the component live in the /apps/acs-commons folder for it to work. Like I said, though your code does show a solution, the issue I was having was a very simple one that is easily missed in the solution you provided.

 

What fixed my issue was simply changing the value of the 

cmp-embed-dialog-edit-showhidetargetvalue 

property in my design dialog and edit dialog to where my component lives in the apps root. I'm still going to test what happens if I change the embed component's version. 

Answering my question with the above issue would be so much clearer and less work. The actual part that was the problem gets lost in the scope of your answer.

 

Sorry but that is just how I feel. I still don't like people saying that their solution is THE answer. Most of the time when someone has done this, they didn't even answer the question that was asked and was not an actual correction or the correct information. Just my opinion. I think the person asking the question should be the one to say if a response resolves their question. 


@robert-harper 

Glad that it worked for you.

I agree with you that, the answer should be marked by Author if it is correct or not, in case author don't do for long and moderator feel that's the correct one then it is ok to mark correct

1 reply

arunpatidar
Community Advisor
Community Advisor
September 27, 2022

Hi,

I have created the custom emabdable e.g. googlemap or iframe,

 

My component looks like below

/aaps/mycomp/components/content/embed/embeddable/googlemap

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Component"
    jcr:title="Google Map"
 sling:resourceSuperType="core/wcm/components/embed/v1/embed/embeddable"
componentGroup=".hidden"/> 

 

dialog

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> <items jcr:primaryType="nt:unstructured"> <location jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textarea" cols="{Long}3" fieldDescription="Location" fieldLabel="Location" name="./loc"/> </items> <granite:data jcr:primaryType="nt:unstructured" cmp-embed-dialog-edit-embeddableoptions="true" cmp-embed-dialog-edit-showhidetargetvalue="mycomp/components/content/embed/embeddable/googlemap"/> </jcr:root>

 

Arun Patidar
Robert-Harper
Level 3
September 27, 2022

I noticed that you are extending the V1 embeddable. Are you also using the V1 Embed component?

arunpatidar
Community Advisor
Community Advisor
September 27, 2022

Yes, when I implemented this, I was using V1, there were no V2 available. 

Arun Patidar