Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Can I mix HTL and SPA components in page?

Anudeep_Garnepudi
Community Advisor
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
kautuk_sahni
Community Manager
Community Manager

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.

Anudeep_Garnepudi
Community Advisor
Community Advisor

@Vaibhavi_Gowda , @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.

Nikhil-Kumar
Community Advisor
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.