dimanche 28 décembre 2014

Reuse a partial with different content, in the same view


As described in the Sails.js documentation:



All of your locals will be sent to the partial automatically.



So I was wondering how I can use the same partial multiple times, in the same view, but with different content.


Let's say I have a list of the top 3 users, and a list of the newest 3 users. The lists have the same HTML structure, and same CSS styling but their content is different.


How can I use the same partial (user/list.ejs for example) to display both the lists? Does anyone know if there's a way to pass specific data to the partial, instead of the view locals?


Thanks in advance.


Dennis





Aucun commentaire:

Enregistrer un commentaire