Hi All,
I have to create multiple content service which can be consume multiple channel web, mobile.
Just need your advise like what would be the best way to create contents like using content fragment or create pages with help of component. I see some pain-point while using CF :
1. If I need to add new key-value I need to update model for new key each time. Don't want code changes if need to add new key-value
2. Is CF is good option for large size contents.
your suggestions are really appreciated. (AEM 6.5.15)
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
If I need to add new key-value I need to update model for new key each time. Don't want code changes if need to add new key-value
You can inject new values in CF, but you won't be able to view them.
CFM are like templates. They need to be pre-defined. If someone alters CFM, it affects all CF, GraphQL results etc. Thus, it should be regulated.
Also, in integrations, there should be a pre-defined contact. A system should not be allowed to push random values.
If you have a requirement for dynamic key/value pairs, may be you want to consider Json Object field for it
2. Is CF is good option for large size contents.
CF has only text/references, so its size shouldn't be big.
The issue that you might have will be with number of fields.
I would suggest you design your CF is a more structed format. A CF with too many fields would also be difficult to author, GraphQL queries would be complex and you will also hit challenges with AEM UI.
For basic guidelines, please refer to: https://techrevel.blog/2023/10/04/content-fragment-models-and-graphql-queries-for-aem-headless-imple...
Hi, you can use a hybrid approach based on your specific needs. If large-size contents are a concern, you can test and evaluate the performance of content fragments in your use case. There is no such proof that using content fragments is a good option for large size content as eventually CF also use Out of the Box components for example textfield, multifield, path browser etc. For the scenarios you mentioned you can use both of them depending on your requirements. If the content is constant in many pages consider using CF and for little changes you can create variations of your CF.
1. For multiple channel content: It can be handled by both using component and CF. Using component you can provide different authoring options for multiple channels and using CF you can create its variations.
2. For large size content: If the content is constant and is being used on many pages then using a CF would be best. Dragging the component on each page and then authoring the same images would be tiring. I don't think that the size would matter but you can try both approaches and test which one is fast.
3. Key-value requirement: You can use multifield in any case and make variations of your CF or the update the existing CF (based on requirement) each time you want to add a new key value pair. Please let me know the requirement. We can use both CF or component in this also.
If I need to add new key-value I need to update model for new key each time. Don't want code changes if need to add new key-value
You can inject new values in CF, but you won't be able to view them.
CFM are like templates. They need to be pre-defined. If someone alters CFM, it affects all CF, GraphQL results etc. Thus, it should be regulated.
Also, in integrations, there should be a pre-defined contact. A system should not be allowed to push random values.
If you have a requirement for dynamic key/value pairs, may be you want to consider Json Object field for it
2. Is CF is good option for large size contents.
CF has only text/references, so its size shouldn't be big.
The issue that you might have will be with number of fields.
I would suggest you design your CF is a more structed format. A CF with too many fields would also be difficult to author, GraphQL queries would be complex and you will also hit challenges with AEM UI.
For basic guidelines, please refer to: https://techrevel.blog/2023/10/04/content-fragment-models-and-graphql-queries-for-aem-headless-imple...
@aanchal-sikka Thank you for your comments. I thought of using JSON Object datatype in CFM, but the authoring experience is not good.
@maddy_23 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.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies