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
57 changes: 57 additions & 0 deletions manual/en-US/coding-standards/chapters/xml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## XML Files

### Attributes

* Each attribute is on its own line.
* The four attributes `name`, `type`, `label` and `description` should be written in this order and at the top of the element definition.

### Closing Elements

Elements should be closed with the closing tag on a new line.

### Exception

When the element only has few attributes, then the whole element can stay on the same line.
A max line length of 100 characters is recommended for good reading.

#### Examples

Element is **empty**:
````
<field
name="abc"
type="text"
label="Empty Field"
description="Empty field without options"
/>
````

Element is **not empty**:
````
<field
name="abc"
type="radio"
label="Field"
description="Field with options"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field
name="abc"
type="radio"
label="Field"
description="Field with options"
>
<option
value="1"
foo="bar"
>
SOMETHING_VERY_LONG
</option>
<option value="0">
SOMETHING_VERY_LONG
</option>
</field>
````
1 change: 1 addition & 0 deletions manual/en-US/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Inline Code Comments](coding-standards/chapters/inline-comments.md)
- [DocBlocks](coding-standards/chapters/docblocks.md)
- [PHP Code](coding-standards/chapters/php.md)
- [XML](coding-standards/chapters/xml.md)
- **Clientside Syntax Styleguides**
- [HTML](coding-standards/chapters/html.md)
- [CSS](coding-standards/chapters/css.md)
Expand Down