Expand my Community achievements bar.

AEM SPA (React) - Handle multiple selectors in the model.json call

Avatar

Level 1

Hello,

I have a use case where I need the model call on the React side to be able to handle multiple selectors or ignore extra selectors in the JSON call URL.

 

E.g. mysite.model.json and mysite.model.param1.param2.json should both be able to render correctly through the Page component on the react side.

 

Adobe's documentation here says that "Additional custom selectors can be defined and used as part of an SPA developed for the AEM SPA SDK. However this support requires that the model selector be the first selector and the extension be .json as required by the JSON Exporter."

 

However, there is no further documentation on how to set this up.

 

This forum post here asks a similar question, but there haven't been any answers specifically regarding how to implement the front-end / react side.

 

Has anyone successfully gotten this to work, or is there some documentation somewhere / sample code that I may have missed?

 

Thanks!

  

0 Replies