Skip to content

Commit cc33bfb

Browse files
committed
fix(add-another): allow itemsHtml to be set via params as well as via caller
1 parent 5fa6562 commit cc33bfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/moj/components/add-another/template.njk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
{%- from "govuk/components/fieldset/macro.njk" import govukFieldset -%}
33
{%- from "govuk/components/button/macro.njk" import govukButton -%}
44

5+
{% set itemsHtml = params.itemsHtml if params.itemsHtml else caller() %}
6+
57
{% set classNames = ["moj-add-another"] %}
68
{% if params.layout == 'inline' %}
79
{% set classNames = classNames.concat("moj-add-another--inline") %}
@@ -27,7 +29,7 @@
2729
</template>
2830

2931
<div class="moj-add-another__items">
30-
{{ caller() | safe }}
32+
{{ itemsHtml | safe }}
3133
</div>
3234

3335
<div class="moj-button-action">

0 commit comments

Comments
 (0)