Skip to main content
Level 8
March 24, 2021
Solved

How to create a content fragment model in code?

There are tutorials showing how to create a content fragment model via the web UI. This is of little use, as this will exist only on a developers local instance.

 

We need a way to create content fragment models in our projects repository, so that we can build and deploy it to all our environments, and so that other developers get the model when they checkout the code from git and build / install?

 

We have the same issue with page template types.

 

Any ideas?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
aanchal-sikka
aanchal-sikkaAccepted solution
Community Advisor
December 15, 2023

The content fragment models / Templates can be made part of ui.content module to be deployed on all servers.

 

  1. Create a CFM using Web UI
  2. Package the CFM and download
  3. Add the CFM to ui.content module of the project. Update filter.xml (preferably set the mode to update)
  4. Deploy code

Once deployed, you would be able to access the CFM on server or other developer's system

Aanchal Sikka

3 replies

Adobe Employee
December 5, 2022

Hi,

 

I'm part of the product team.

We have a new API for managing Content Fragment models about to be released.

 

There's a JSON payload to provide as request body.

How do you store those models today?

 

Regards,

Gilles

Translate
aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
December 15, 2023

The content fragment models / Templates can be made part of ui.content module to be deployed on all servers.

 

  1. Create a CFM using Web UI
  2. Package the CFM and download
  3. Add the CFM to ui.content module of the project. Update filter.xml (preferably set the mode to update)
  4. Deploy code

Once deployed, you would be able to access the CFM on server or other developer's system

Translate
Aanchal Sikka