Is there a way to render the entire AEM page in an experience fragment?
I have a homepage that contains around 10 components. Now, I want to create a replica of the home page in the experience fragment and export it to AT. Since most of my components are tightly coupled and I cannot use the components directly in experience fragment. So, I'm looking for something that will bring the entire HTML DOM for the homepage and render in experience fragment via some custom component. I have tried the below servlet, but I'm getting an internal server error.
Here is couple of options you can try based on your need
1. if your home page components are authored inside container like layout/grid or similar then you can convert to experience fragment directly from page.
But, that will change the content from home to experience fragment now as it will be referenced to experience fragments created. but also do this
- configure AT cloud service configuration
- configure OOTB experience fragment template or if you use custom experience frag template to support your component design to display correct when access as experience fragment page, to view correctly going forward for authors
- configure replication agent for this experience fragment template
- export it to AT and deliver to home page as exp frag content
Directly hit page(/content/myapp/en/us_en/home.html) from front-end(AJAX) and you will get entire page html as response. You can request for child nodes also(/content/myapp/en/us_en/home/_jcr_content/root/...../xyz.html).