Stefan Kendall
Stefan Kendall

Reputation: 67802

GSP include - with parameters -within g:each?

I have some common structure that I'd like to use, and I need to nest it within a <g:each />. The semantic solution seems to be to create a taglib, but I'd rather write GSP code to construct the structure, as it's easier to read/maintain.

Essentially, I need this:

<g:each ...>
  //Somehow include a GSP that takes parameter "datastructure1"
  //Again with "datastructure2"
</g:each>

A GSP include takes params, but it's not nestable in a <g:each />. What am I looking for?

Upvotes: 0

Views: 913

Answers (2)

Ho&#224;ng Long
Ho&#224;ng Long

Reputation: 10848

You can call a taglib, then in the taglib function: render a template. There's an example here.

Upvotes: 1

Stefan Kendall
Stefan Kendall

Reputation: 67802

<g:include> works as you need it to. Try again.

Upvotes: 2

Related Questions