How to call/access multiple sling model classes to one html file using sightly | Community
Skip to main content
Level 2
October 26, 2023
Question

How to call/access multiple sling model classes to one html file using sightly

  • October 26, 2023
  • 1 reply
  • 596 views

Can we access multiple sling model classes to one html file using sightly?


Example:  I have two classes MultiDataFetchermodelOne and MultiDataFetchermodelTwo

 

<div data-sly-use.multiDataFetcher="${'com.myproject.core.models.MultiDataFetchermodelOne'}">
// logic here
</div>
 
How can I call the 2nd model class (MultiDataFetchermodelTwo) in the same html file?


 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

October 28, 2023
 
Can you please try with this below code
 
<div data-sly-use.multiDataFetcher="${'com.myproject.core.models.MultiDataFetchermodelOne'}">
<sly data-sly-use.multiDataFetcherTwo="${'com.myproject.core.models.MultiDataFetchermodelTwo'}">
//logic here
</sly>
</div>