Content Fragment Variation | Community
Skip to main content
Level 3
August 14, 2022
Solved

Content Fragment Variation

  • August 14, 2022
  • 1 reply
  • 982 views

Hi All - I have a field in the dialog to select the content fragment. I am using pathbrowser to select the CF in the dailog. I could only see the content fragment not the variation. is there a way to display the content fragment variation for the selection.

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 lukasz-m

Hi @s1101v,

This is possible, to see content fragment variants using pathborwser, but it will not be author friendly and there is better option for that. Please find the details below.

Here is my sample CF, it contains 2 variants: Master and Secondary

Here is how I can configure path field to get access to CF variants via pathbrowser.

As you can see the I am using nosystem filter to see variants of CF. You can get more info about available pathbrowser filters under: https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html

The result is like that.

I can browse and select CF variants (they are stored as a renditions in the repository), nevertheless I can also see some other folders and files that most likely should not be visible for authors. But the main goal to get access to variants via pathfield has been achieved.

The other option, which in my opinion is better will be to use dedicated dam/cfm/components/cfpicker and select. This is something that has been done in Content Fragment component from core components, you can find full code under https://github.com/adobe/aem-core-wcm-components/blob/main/content/src/content/jcr_root/apps/core/wcm/components/contentfragment/v1/contentfragment/_cq_dialog/.content.xml

This is much cleaner solution from authoring perspective, and it looks like this.

First author is selecting CF, and next he/she can choose variant for specific CF.

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
August 14, 2022

Hi @s1101v,

This is possible, to see content fragment variants using pathborwser, but it will not be author friendly and there is better option for that. Please find the details below.

Here is my sample CF, it contains 2 variants: Master and Secondary

Here is how I can configure path field to get access to CF variants via pathbrowser.

As you can see the I am using nosystem filter to see variants of CF. You can get more info about available pathbrowser filters under: https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html

The result is like that.

I can browse and select CF variants (they are stored as a renditions in the repository), nevertheless I can also see some other folders and files that most likely should not be visible for authors. But the main goal to get access to variants via pathfield has been achieved.

The other option, which in my opinion is better will be to use dedicated dam/cfm/components/cfpicker and select. This is something that has been done in Content Fragment component from core components, you can find full code under https://github.com/adobe/aem-core-wcm-components/blob/main/content/src/content/jcr_root/apps/core/wcm/components/contentfragment/v1/contentfragment/_cq_dialog/.content.xml

This is much cleaner solution from authoring perspective, and it looks like this.

First author is selecting CF, and next he/she can choose variant for specific CF.