Skip to content

Commit 852730c

Browse files
committed
Documentation for Section
1 parent 6a43828 commit 852730c

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

docs/the-section.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ The start and end HTML of the Section are generated via the `BeginSection` and `
5656

5757
## Default usage
5858

59+
# [Tag Helpers variant](#tab/default-section-th)
60+
61+
In order to output a default instance of a Section you can use the `<form-section>` tag helper within a `<chameleon-form>`, e.g.:
62+
63+
```cshtml
64+
<form-section heading="Heading">
65+
@* Section fields go here *@
66+
</form-section>
67+
```
68+
69+
70+
# [HTML Helpers variant](#tab/default-section-hh)
71+
5972
In order to get an instance of a `Section<TModel>` you can use the `BeginSection` method on the Form, e.g.
6073

6174
```cshtml
@@ -144,7 +157,29 @@ The `BeginSection` extension methods look like this:
144157
}
145158
```
146159

147-
From within a Section you can create [Fields](field.md) and you can also create nested sections using the `BeginSection` extension method off the Section:
160+
161+
***
162+
163+
You can extend the Section by adding [HTML attributes](html-attributes.md) to it.
164+
165+
From within a Section you can create [Fields](field.md) and you can also create nested sections:
166+
167+
# [Tag Helpers variant](#tab/nested-section-th)
168+
169+
Using a nested `<form-section>` tag helper:
170+
171+
```cshtml
172+
<form-section heading="Heading">
173+
@* Fields... *@
174+
<form-section heading="Inner Heading">
175+
</form-section>
176+
@* Fields... *@
177+
</form-section>
178+
```
179+
180+
# [HTML Helpers variant](#tab/nested-section-hh)
181+
182+
Using the `BeginSection` extension method off the Section:
148183

149184
```cshtml
150185
@using (var s = f.BeginSection("Heading")) {
@@ -244,6 +279,8 @@ The `BeginSection` extension methods on Section look like this:
244279
}
245280
```
246281

282+
***
283+
247284
## Default HTML
248285

249286
### Begin HTML

0 commit comments

Comments
 (0)