Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Is there a way to create a project structure for both SPA and Non SPA components?

Avatar

Level 2
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

HI @sukghosa ,

IMO, it's not possible to mix a Non SPA and SPA component in SPA page, If you want to create any component using SPA template then it's not possible.

  • You can try adding some text or something at the page template level (Which will be hardcoded not a draggable component), But this will be effective across the template.
  • You can have your own template created and and create HTL component in the same project structure.

NOTE: You can not use non SPA component in SPA template. As in SPA everything is client-side rendered.
If you see the body.html we only have root div to render at react side.

You can check out this article [0] on the same, for more details.

[0]: https://aemsimplifiedbynikhil.wordpress.com/2020/08/18/aem-spa-react-project-setup-and-component-int...

Hope that helps you!

Regards,

Santosh

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

HI @sukghosa ,

IMO, it's not possible to mix a Non SPA and SPA component in SPA page, If you want to create any component using SPA template then it's not possible.

  • You can try adding some text or something at the page template level (Which will be hardcoded not a draggable component), But this will be effective across the template.
  • You can have your own template created and and create HTL component in the same project structure.

NOTE: You can not use non SPA component in SPA template. As in SPA everything is client-side rendered.
If you see the body.html we only have root div to render at react side.

You can check out this article [0] on the same, for more details.

[0]: https://aemsimplifiedbynikhil.wordpress.com/2020/08/18/aem-spa-react-project-setup-and-component-int...

Hope that helps you!

Regards,

Santosh