Node.js template - partials - can these be used within a repeat region as the child, and so the data will change based on the data bound to the repeat?

Hey all,

Still building out our app - we have a complex API query to ElasticSearch that returns data - wondering if it would make most sense to use a partial for the way we present the data (a card) - can this then be ‘repeated’ say a list of 10, each with different records from the API?

1 Like

Gently bumping this. Slight different us case to that of our ES query - this will be for the directory - it would be super useful if a partial could be used in a repeat and as long as the data binding names remain the same, the data within the partial, that’s repeated would change based on the repeat group.

You should see the partials as black boxes. They have input parameters they can render in their body.

And when calling the partial you just supply the input parameters. You can bind them to what ever you want. That could be also data from the repeat region when the partial is called inside.

1 Like

This will be super, super helpful if I can make it work as desired!

George, this works perfectly.

Question - is it possible to include modals with associated server connects (e.g. server connect form) as a partial on a page, too?

Yes sure as long as it is self containing and made depending of just the partial input params.

1 Like