Allow templating with multiple field values
We had a lot of discussions about the ability to write templates instead of using the widget system in SIB.
To do this, we could use the same syntax as for the sets. Here is an example of how it could work:
<solid-display
data-src='data/list/user-1.jsonld'
fields='my-template(name, email, profile)'
widget-my-template="custom-template"
></solid-display>
<solid-widget name="custom-template">
<template>
<p>
${value.name} is coming from ${value.profile ? await value.profile.city : ''}.
You can send him an email at <b>${value.email}</b>.
</p>
</template>
</solid-widget>
Here is an example of implementation: ed81f415
On one side, it gives more flexibility to the developer. The main drawback is that it can be more complex to industrialize apps in the future if the templates are too widely used.
@balessan @jbpasquier @fabien4vo @Marjolaine as application developers, we would like to have your opinion on this.
Would you use this syntax? Would you be tempted to use only this one?