Putting a Component in a Content Fragment | Community
Skip to main content
anupampat
Community Advisor
Community Advisor
June 28, 2018
Solved

Putting a Component in a Content Fragment

  • June 28, 2018
  • 6 replies
  • 2035 views

Can we put a component in a Content Fragment ?

​For example - I have this component that forms a table on a page (Values displayed are generated depending upon selection in dialog), so now I want to put this component in a content fragment and store it as an asset, so that same component/content fragment can be used on multiple pages to form different table values. Is this possible in AEM 6.3 or even through codes ?

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

for this you can use Experience fragmant.

you can put CF and components in XF. and can use XF in multiple pages.

Please check  Configure cq:xfVariantType in experience fragment.  for example

Thanks

Arun

6 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
June 28, 2018

for this you can use Experience fragmant.

you can put CF and components in XF. and can use XF in multiple pages.

Please check  Configure cq:xfVariantType in experience fragment.  for example

Thanks

Arun

Arun Patidar
anupampat
Community Advisor
anupampatCommunity AdvisorAuthor
Community Advisor
June 28, 2018

Thanks Arnup. This is what I required.

anupampat
Community Advisor
anupampatCommunity AdvisorAuthor
Community Advisor
June 28, 2018

arunp99088702​ I have one more question here, so content fragment is kind of an asset and we can use   /api/assets/samplefragment.json to expose the json, do we any APIs that can expose the same for EF ?  And the api/assets actually helps download the content fragment also. Do we have anything similar to that for EF ? My requirement is more like storing the EF as an asset.

arunpatidar
Community Advisor
Community Advisor
June 28, 2018

Hi you can model selector with json extension to expose XF as json.

It'll show output like below for http://localhost:4502/content/experience-fragments/aem64app/experience-fragment2/master.model.json

more info Adobe Experience Manager Help | Set up Content Fragments and Content Services in AEM

Thanks

Arun

Arun Patidar
anupampat
Community Advisor
anupampatCommunity AdvisorAuthor
Community Advisor
June 28, 2018

http://localhost:4502/content/experience-fragments.infinity.json  This will serve the same purpose, won't it ? Anyways I will try out the Model selector as well, but do you have any idea how do I store the EF as an asset because the implementation is of cq:page for EF ?

arunpatidar
Community Advisor
Community Advisor
June 28, 2018

Yeah, It is more or less similar to infinity selector but not the same , if you are planning to expose content as a service, better to you model selector.

you can't save experience fragments(XF) as a assets but you can use XF inside any page like CF.

Arun Patidar