Correct Method to add a CF to a Custom Component | Community
Skip to main content
Level 3
August 30, 2018
Solved

Correct Method to add a CF to a Custom Component

  • August 30, 2018
  • 4 replies
  • 2359 views

I've been looking around and figured I'd ask the collective knowledge base here on the best way to add a CF to a Custom Component for AEM 6.3.

Is it better to the proxy the WCM Core Component Extension CF then just copy/extend it's dialog etc.. or is it better to dam/cfm/components/cfpicker to a dialog and just customize how the CF itself is then displayed in the component?  Or better yet is there some way to reference the entire CF dialog as a reference within my current component dialog?

Also if there are any examples out there, I haven't been able to find any good ones showing this type of integration.

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

Hi,

you can check the existing foundation CF component at /libs/dam/cfm/components/contentfragment

and extract the java and html part from there and use inside your component.

4 replies

smacdonald2008
Level 10
August 30, 2018

Content Fragments act like a component - as discussed here - -Adobe Experience Manager Help | Working with Adobe Experience Manager Content Fragments

As you can see - you drag a content fragment onto an AEM page - like other AEM components- such as a custom HTL component.

smacdonald2008
Level 10
August 30, 2018

Also - discussed here: Page Authoring with Content Fragments

If you want to develop a custom component - then you should not use Content Fragments. You should use Sling Models and HTL.

Level 3
August 30, 2018

Let me clarify a bit further then.  We're developing a custom component in HTL.  We already have our dialog setup, and the component displaying fine on our pages.  What we'd like to do is add the ability for an Author to select a Content Fragment when using our new component to display some content within the component.

My question is, what is the easiest way to add the ability for an Author to select a CF in the dialog, and what's the easiest way to display the select CF within the component.

After looking at the WCM Core Component v1 version I see there's a specific /cfpicker resourceType, but the display from the WCM Core's contentfragment.html file seems rather complex.

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 30, 2018

Hi,

you can check the existing foundation CF component at /libs/dam/cfm/components/contentfragment

and extract the java and html part from there and use inside your component.

Arun Patidar