Expand my Community achievements bar.

Can I mix HTL and SPA components in page?

Avatar

Community Advisor

Hello Guys,

Is there any way to mix HTL and SPA components in a page (SPA or non SPA template)? Chris Millar at adaptTo conference 2018 said that it is not possible yet. Is there way now? Any Ideas? Thanks.

-AG

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Administrator

See the reply from @Nikhil-Kumar 

 

 

If you want to create any component using SPA template then it's not possible.
But 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 my article on the same, soon I will be coming up with one article in which I will list down the issues that I faced during my AEM+SPA project experience.



Kautuk Sahni

Avatar

Community Advisor

@Vaibhavi_J , @kautuk_sahni 

Thanks for quick reply. My case is like 2 custom components on page

  1. First/top component only uses HTL as view, no react
  2. Second/bottom component only uses react as view and no HTL

Idea is like the components that are always on top of page will develop using HTL and components which are always used down the page will develop using React.

Avatar

Community Advisor

@Anudeep_Garnepudi - As far as I know it's not possible to mix a Non SPA and SPA component in SPA page.
But you can try adding 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.