Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Can we add a label in Content Fragment Model.

Avatar

Level 4

Hi Team

 

I am trying to implement some new logic in Content Fragment Model and would like to have editable headers in Content fragment model. In the ootb data types of content fragment model there is no option add headers or label (just label without any input field)

 

Could you please suggest how to achieve this.

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @Prashardan, You can leverage the text field for this purpose by creating Text fields in your CFM with descriptive names that clearly indicate their purpose as headers.These fields can hold the header text.

There is also an option of overlaying/extending the CFM and add your own custom field i.e label in it. You can refer the below links for the same:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/extending-overlaying-a-con...

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/con...

I would suggest you to go with the first option as this approach requires in-depth knowledge. Even if you are able to customize the CFM in CRXDE, you also have to do it via coding/development.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 6

Hi @Prashardan, You can leverage the text field for this purpose by creating Text fields in your CFM with descriptive names that clearly indicate their purpose as headers.These fields can hold the header text.

There is also an option of overlaying/extending the CFM and add your own custom field i.e label in it. You can refer the below links for the same:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/extending-overlaying-a-con...

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/con...

I would suggest you to go with the first option as this approach requires in-depth knowledge. Even if you are able to customize the CFM in CRXDE, you also have to do it via coding/development.

Avatar

Community Advisor

@Prashardan 

 

Can you possibly explain your use-case with an example?


Aanchal Sikka

Avatar

Level 4

Thanks for your reply.

 

I want to have editable header in my content fragment model and I want to have variations for this header when content fragment is created from this model.

Avatar

Level 10

Hello @Prashardan ,

Adobe Experience Manager (AEM) does not provide a built-in option to add labels or headers directly within a Content Fragment Model. However, you can achieve a similar outcome by utilizing custom fields or structured content within your Content Fragment Model.

Here are a few approaches you can consider:

  1. Custom Metadata Fields: You can create custom metadata fields within your Content Fragment Model to represent labels or headers. These fields can be of type Text or Rich Text, allowing authors to input custom labels or headers for the content fragment.

  2. Structured Content: Instead of using labels or headers within the Content Fragment Model itself, you can structure the content fragment's elements or fields in such a way that they inherently include headers or labels. For example, you could organize your content fragment fields hierarchically, with each field having a corresponding label or header.

  3. Component Composition: When using Content Fragment Models in conjunction with AEM Components, you can incorporate labels or headers directly within the component's rendering logic. This allows you to define headers or labels within the component markup while still utilizing the structured content provided by the Content Fragment Model.

  4. Custom Development: If the above approaches do not meet your requirements, you can explore custom development options to extend the functionality of Content Fragment Models. This may involve developing custom Content Fragment Model extensions or integrating with other AEM features to achieve the desired labeling or header functionality.

When implementing any of these approaches, consider the authoring experience and ensure that it aligns with the content author's expectations and usability requirements. Additionally, document any customizations thoroughly to facilitate future maintenance and understanding by other team members

Avatar

Administrator

@Prashardan Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni