Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions docs/general-concepts/forms-fields/standard-fields/headertag.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,43 @@ sidebar_position: 2
title: Headertag Form Field
---

The **headertag** form field type provides a dropdown list of h1 to h6 as options.
The **headertag** form field type provides a dropdown list of tags for a module title. The preset list of tags includes h1 to h6, p and div. Custom modules may specify additional tags.

- **type** (mandatory) must be *headertag*.
- **name** (mandatory) is the unique name of the field.
- **label** (mandatory) (translatable) is the field html label.
- **description** (optional) (translatable) is the [field description](../standard-form-field-attributes.md#description).
- **default** (optional) (not translatable) is the default value.
- **type** must be *headertag*.
- **name** is the unique name of the field.
- **label** is a translatable label for the field.
- **description** is an optional translatable [field description](../standard-form-field-attributes.md#description).
- **default** is an optional default value.

Implemented by: libraries/src/Form/Field/HeadertagField.php

## Example XML parameter definition
## Example XML parameter definitions

Example definition that displays the preset list of header tags to choose from:

```xml
<field
name="header_tag"
type="headertag"
label="COM_MODULES_FIELD_HEADER_TAG_LABEL"
description="COM_MODULES_FIELD_HEADER_TAG_DESC"
default="h3"
/>
```

Example definition that displays the preset list of header tags with additional options:

```xml
<field
<field
name="header_tag"
type="headertag"
label="COM_MODULES_FIELD_HEADER_TAG_LABEL"
description="COM_MODULES_FIELD_HEADER_TAG_DESC"
default="h3"
/>
>
<option value="span">span</option>
<option value="figcaption">figcaption</option>
<option value="legend">legend</option>
<option value="summary">summary</option>
</field>
```
33 changes: 26 additions & 7 deletions docs/general-concepts/forms-fields/standard-fields/moduletag.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,42 @@ sidebar_position: 2
title: Moduletag Form Field
---

The **moduletag** form field type provides a dropdown list of html5 elements (used to wrap a module in).
The **moduletag** form field type provides a dropdown list of tags for a module wrapper. The preset list of tags includes most suitable wrapper tags: address, article, aside, details, div, footer, header, main, nav and section. Custom modules may specify additional tags.

- **type** (mandatory) must be *moduletag*.
- **name** (mandatory) is the unique name of the field.
- **label** (mandatory) (translatable) is the field html label.
- **description** (optional) (translatable) is the [field description](../standard-form-field-attributes.md#description).
- **type** must be *moduletag*.
- **name** is the unique name of the field.
- **label** is a translatable label for the field.
- **description** is an optional translatable [field description](../standard-form-field-attributes.md#description).
- **default** is an optional default value.

Implemented by: libraries/src/Form/Field/ModuletagField.php

## Example XML parameter definition
## Example XML parameter definitions

Example definition that displays the preset list of module tags to choose from:

```xml
<field
ame="module_tag"
name="module_tag"
type="moduletag"
label="COM_MODULES_FIELD_MODULE_TAG_LABEL"
description="COM_MODULES_FIELD_MODULE_TAG_DESC"
default="div"
/>
```

Example definition that displays the preset list of module tags with additional options:

```xml
<field
name="module_tag"
type="moduletag"
label="COM_MODULES_FIELD_MODULE_TAG_LABEL"
description="COM_MODULES_FIELD_MODULE_TAG_DESC"
default="div"
>
<option value="blockquote">blockquote</option>
<option value="figure">figure</option>
<option value="form">form</option>
</field>
```