what is the best way to load html from a widget if your looping through a data set?
i.e. in a hamlet file
$forall Entity id val <- collection
^{myWidget (p1 val) (p2 val)}
what is the best way to load html from a widget if your looping through a data set?
i.e. in a hamlet file
$forall Entity id val <- collection
^{myWidget (p1 val) (p2 val)}
Note that Hamlet template can embed only hamlet template. If you want to embed a widget, use
whamlet
.Also, yes - you can pass parameters to a widget. An example stack script demonstrating the concept:
The widgets chapter on Yesod book explains them more deeply.