Expand my Community achievements bar.

SOLVED

Content Fragment Variation

Avatar

Level 4

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

cf.jpg

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

crx.png

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/...

The result is like that.

cf-pathfield.jpg

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/wc...

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

cf-core.jpg

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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

cf.jpg

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

crx.png

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/...

The result is like that.

cf-pathfield.jpg

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/wc...

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

cf-core.jpg

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