Expand my Community achievements bar.

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

Avatar

Level 2

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?


 
1 Reply

Avatar

Level 1
 
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>