Elements
Section element
A Section wraps a run of blocks into one unit, with an optional title printed above them. Once grouped, the blocks move, duplicate, delete, take a background or border, break across pages and show or hide together. Use it for a titled part of a document such as "Payment terms", a tinted callout band, or a group that must stay on one page.
A Section neither repeats nor chooses its content. To print blocks once per item in a list, use a Repeat (see Repeat element); to print blocks only when your data meets a condition, use a Conditional (see Conditional element).
Changing a template needs the editor role or higher in the hosted product; local mode has no roles.
Add one
There are two ways in.
- To start empty, open the add-block menu (Add block at the top of the Outline, or the + that appears between blocks on the canvas in Flow view) and pick Section under Logic & Layout. It arrives titled "New section", holding one paragraph, "Section body".
- To group blocks you already have, click the first one's row in the Outline, then ⌘-click (Ctrl-click on Windows) the rows of its neighbours at the same level. In the properties panel's Group box, press Group 3 blocks (the number matches your selection), or open the ⋯ menu at the end of a selected row and choose Group selection. The new Section has no title. If the selected blocks are not next to each other, the button is unavailable and the panel says Select a contiguous run of sibling blocks to group them.
A Section can go anywhere a block can: the document body, inside another Section, in a column or grid cell, inside a Conditional, or inside a Repeat, where it prints once per item.
To select a Section, click its title on the canvas, or its Outline row, which reads Section · followed by its title, or untitled. To add a block inside it, use the + between its blocks on the canvas, or select one of them and press Add block.
Properties
Open the properties panel with ⌘. (Ctrl+. on Windows) or the panel button at the far right of the app bar (tooltip Show properties panel).
Section
- Title — printed above the Section's blocks as a bold heading, in the document's Primary color and a little larger than body text. Clear the field to remove it; nothing prints in its place. To make it italic, underlined or struck through, double-click the title on the canvas in Flow view and use the formatting bubble; the formatting applies to the whole title.
- Ungroup section — removes the Section and puts its blocks back where it stood, in order, dropping the title and the Section's settings. The ⋯ menu on the Section's Outline row offers the same as Ungroup. Undo regroups the blocks and restores the Section's settings, including its title, Start on a new page, Show only when and its styling rules.
Box and Spacing
The Box and Spacing panels work as on other elements (see Shared element properties). On a Section they apply to the whole group: a background or border wraps the title and every block inside, and a Line height (×) carries down to text that does not set its own.
Page breaks
- Start on a new page — break before this section — off by default. The Section, title included, starts at the top of a new page.
- Keep together — don’t split across pages — off by default. If the Section does not fit in the rest of the page, it moves to the next page whole. A Section taller than a page splits anyway; when Weft estimates that it is, it notes This group is taller than a page — it will still split where it must. and marks the Outline row.
- Keep with next block — stay with what follows — off by default. Keeps the Section on the same page as the block after it.
See Control page breaks for how these combine.
Conditional
- Show only when a condition is met — hides the whole Section, title included, when the condition fails; the panel restates it as "Shown when …". A new condition starts with a stand-in field that is not in your data, so ticking the box hides the Section from the canvas at once, until the finished condition holds (see Show only when).
- Conditional styling — + Add styling rule changes the Section's look when a condition holds (see Conditional formatting). On a Section, a rule's Fill and Font take effect; Text color and Size (pt) do not.
How it prints
A Section prints its title, if it has one, then its blocks, with a little space above and below the group. Without a page-break setting, it breaks across pages like any other content.
Good to know
- A Section always holds at least one block: Weft will not delete or drag out the last one, so use Ungroup section or delete the Section. Deleting it asks you to confirm and removes every block inside.
- Duplicate copies the Section with everything inside it.
- To reuse a Section in other templates, select it on the canvas in Flow view, open the toolbar above it with the small button whose tooltip is Formatting options, and press Save (see Reusable components).
- To give each item of a list its own card, put a styled Section inside a Repeat.
- To show a styled group only sometimes, give the Section Show only when a condition is met rather than wrapping it in a Conditional, which has no styling of its own.