Custom Fields Layout Control: Line Position and Line Weight Explained

Custom Fields Layout Control: Line Position and Line Weight Explained

This page explains how to control where and how wide custom fields appear on a
form, using the two placement settings Line Position and Line Weight.


1. The layout hierarchy

Custom fields are organized in four levels:

Form e.g. Case Data form └─ UI Group e.g. Case Data General (a section of the form) └─ Line one horizontal row └─ Field one custom field (with a proportional width)

When a form is opened, SORMAS renders each active field that belongs to the
form's context, is in the correct UI group, and matches the record's disease
(visibility). Within each group the layout rules below are applied.

2. Line Position — ordering and rows

Line Position is a number that determines the order of fields inside a UI group.

  • Fields are sorted by Line Position in ascending order (e.g. 10, 20, 30).

  • Lower values appear higher on the form.

  • Fields that share the same Line Position are placed side by side on the
    same row.

  • Fields without a Line Position are placed at the end of the group — each
    one on its own row.

Field

Line Position

Result

Field

Line Position

Result

First name

10

row 1

Last name

10

row 1 (side by side with First name)

Date of birth

20

row 2

Comment

(empty)

row 3 (own row, at the end)

3. Line Weight — proportional width

Line Weight is a decimal number between 0 and 1 that controls how much horizontal
width a field occupies within its row.

Weight

Meaning

Weight

Meaning

1.0

full width of the form line (default)

0.5

half width (two fields fit on one line)

0.33

one third width (three fields fit on one line)

0.25

quarter width (four fields fit on one line)

Examples

Two half-width fields side by side:

┌───────────────────────────────┬───────────────────────────────────┐ │ First name (weight 0.5) │ Last name (weight 0.5) │ └───────────────────────────────┴───────────────────────────────────┘

Full-width field followed by two half-width fields:

┌────────────────────────────────────────────────────────────┐ │ Comment (weight 1.0) │ ├───────────────────────────────┬────────────────────────────┤ │ Field A (weight 0.5) │ Field B (weight 0.5) │ └───────────────────────────────┴────────────────────────────┘

Three fields on one line:

┌────────────────────┬─────────────────────┬────────────────────┐ │ A (weight 0.33) │ B (weight 0.33) │ C (weight 0.33) │ └────────────────────┴─────────────────────┴────────────────────┘

Practical hint: If one field on a row takes less than full width and nothing
else shares its row, SORMAS adds invisible space next to it so the field keeps
only its proportional width. In other words: give a field a weight of 0.5 only
if you actually plan a second field with 0.5 on the same line — otherwise you
just leave an empty half of the form.

4. Recommended workflow

  1. Sketch the target layout for your UI group on paper (which fields, in which
    order, which widths).

  2. Group fields per visual row and give every field on the same row the same
    Line Position.

  3. Assign Line Weight values that add up to ~1.0 per row
    (0.5 + 0.5, 0.33 + 0.33 + 0.33, 0.25 × 4, …).

  4. Use Line Position gaps (10, 20, 30) so you can insert new fields between
    existing ones later without renumbering everything.

5. Example configurations

Goal

Line Position

Line Weight

Goal

Line Position

Line Weight

One full-width field on top

10

1.0

Two fields on the next line

20 (both)

0.5 / 0.5

Three fields on the next line

30 (all)

0.33 / 0.33 / 0.33

A single field at the end

(empty)

1.0