Skip to content

Commit 00f1df7

Browse files
committed
Added details of read-only partial views for field types.
1 parent 97dbf50 commit 00f1df7

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

13/umbraco-forms/developer/extending/adding-a-fieldtype.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ If working with Umbraco 9 or earlier versions, you'll find the `Views\Partials\F
106106

107107
For Umbraco 10 and above, we've moved to [distributing the theme as part of a Razor Class Library](../../upgrading/version-specific.md#views-and-client-side-files) so the folder won't exist. However, you can create it for your custom field type. If you would like to reference the partial views of the default theme, you can download them as mentioned in the [Themes](../themes.md) article.
108108

109+
### Read-only partial view
110+
111+
When rendering a multi-page form, editors have the option to display a summary page where the entries can be viewed before submitting.
112+
113+
To support this, a read-only view of the field is necessary.
114+
115+
For most fields, nothing is required here, as the default read-only display defined in the built-in `ReadOnly.cshtml` file suffices.
116+
117+
However, if you want to provide a custom read-only display for your field, you can do so by creating a second partial view named with a `.ReadOnly` suffix. For this example, we would create `FieldType.Slider.ReadOnly.cshtml`.
118+
109119
## Umbraco backoffice view
110120

111121
The final step involves building the HTML view which will be rendered in Umbraco as an example of how our end result will look:

14/umbraco-forms/developer/extending/adding-a-fieldtype.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ If working with Umbraco 9 or earlier versions, you'll find the `Views\Partials\F
125125

126126
For Umbraco 10 and above, we've moved to [distributing the theme as part of a Razor Class Library](../../upgrading/version-specific.md#views-and-client-side-files) so the folder won't exist. However, you can create it for your custom field type. If you would like to reference the partial views of the default theme, you can download them as mentioned in the [Themes](../themes.md) article.
127127

128+
### Read-only partial view
129+
130+
When rendering a multi-page form, editors have the option to display a summary page where the entries can be viewed before submitting.
131+
132+
To support this, a read-only view of the field is necessary.
133+
134+
For most fields, nothing is required here, as the default read-only display defined in the built-in `ReadOnly.cshtml` file suffices.
135+
136+
However, if you want to provide a custom read-only display for your field, you can do so by creating a second partial view named with a `.ReadOnly` suffix. For this example, we would create `FieldType.Slider.ReadOnly.cshtml`.
137+
128138
## Field Settings
129139

130140
Field settings will be managed in the backoffice by editors who will create forms using the custom field type. These settings can be added to the C# class as properties with a `Setting` attribute:

15/umbraco-forms/developer/extending/adding-a-fieldtype.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ If working with Umbraco 9 or earlier versions, you'll find the `Views\Partials\F
125125

126126
For Umbraco 10 and above, we've moved to [distributing the theme as part of a Razor Class Library](../../upgrading/version-specific/#views-and-client-side-files) so the folder won't exist. However, you can create it for your custom field type. If you would like to reference the partial views of the default theme, you can download them as mentioned in the [Themes](../themes.md) article.
127127

128+
### Read-only partial view
129+
130+
When rendering a multi-page form, editors have the option to display a summary page where the entries can be viewed before submitting.
131+
132+
To support this, a read-only view of the field is necessary.
133+
134+
For most fields, nothing is required here, as the default read-only display defined in the built-in `ReadOnly.cshtml` file suffices.
135+
136+
However, if you want to provide a custom read-only display for your field, you can do so by creating a second partial view named with a `.ReadOnly` suffix. For this example, we would create `FieldType.Slider.ReadOnly.cshtml`.
137+
128138
## Field Settings
129139

130140
Field settings will be managed in the backoffice by editors who will create forms using the custom field type. These settings can be added to the C# class as properties with a `Setting` attribute:

0 commit comments

Comments
 (0)