Template Designer
Anchoring

Anchoring

Anchoring lets a field sit a fixed distance below another field instead of at a fixed place on the page. Use it wherever the content above a field changes length from one donor to the next.

What anchoring solves

Everything you place in the designer is positioned absolutely. A field stays exactly where you dragged it, whatever renders above it.

That is fine until a field's content changes size. A donor address box sized for four lines still occupies four lines when the donor's address only fills two. The two empty lines print as dead space, and nothing below moves up to close it. Size the box for two lines instead and the four-line address overflows into whatever you placed underneath.

An anchored field escapes that. Instead of "start 412 points down the page", it says "start 12 points below the donor address", and the gap holds whatever the address turns out to be.

What the gap measures

The gap is measured from the bottom of the drawn text, not the bottom of the box that text sits in. This is the one thing about anchoring worth reading twice.

The same donor address box rendering four lines and rendering two. The gap below it is measured from the bottom of the drawn text in both cases, so the gift details field sits higher when the address is short.A long address fills the boxDonor addressA. Featherstonehaugh-WorthingtonApartment 1204, Wellington Cresc/o The Building ManagerWinnipeg MB R3B 1A1Drawn bottomGap 12 ptGift details= box bottomA short address leaves spaceDonor addressAl Ng1 Elm St, Winnipeg MB R3B 1A1Drawn bottomGap 12 ptGift detailsBox bottomDesigned position

The gap is the same 12 points in both halves. What changes is where it starts. On the left the address fills its box, so the drawn text and the box end in the same place. On the right the address is two lines shorter, the drawn text ends higher, and the gift details field rises with it. The dead space is gone without anyone resizing anything.

Gaps are in points, the unit the rest of the designer uses. There are 72 points to an inch, so 12 points is about the height of a line of body text.

This is why an anchored field looks unchanged while you are designing. The canvas draws designed positions until you turn on preview mode, because that is the layout you dragged and the one you are editing. Only preview mode measures real text, so only preview mode closes the gap. See Preview and testing.

Anchoring a field

  1. Select the field you want to move, the one that should sit below something else
  2. Find the Layout group in the field properties panel to the right of the canvas
  3. Under Anchor to, choose the field it should hang below
  4. Set Gap to the distance you want between them

Once a field is anchored, the up and down arrow keys adjust its gap instead of its position. Up closes the gap, down opens it, one point at a time, or ten with Shift held. The left and right arrows still move the field across the page, because anchoring never changes horizontal position.

The Anchor to list only offers fields on the same page, and never offers the field itself or anything already hanging below it. Anchors that would chase their own tail cannot be built.

To remove an anchor, set Anchor to back to None. The field returns to the position you designed it at.

Stacking a block

Anchoring a run of fields one at a time is tedious, so select them all and stack them instead.

GestureWhere
Stack⌘G on a Mac, Ctrl+G elsewhere, the button in the Layout group, or the right-click menu
Unstack⌘⇧G or Ctrl+Shift+G, the Layout group, or the right-click menu

Stack chains the selection top to bottom, anchoring each field below the one above it. It reads the gaps off the canvas as it goes, so a block that already looks right keeps looking right. Stacking is a safe thing to do to a block you are happy with: it changes how the block behaves, not how it looks.

The topmost field in the selection keeps whatever anchor it already had, so you can stack a block below a heading that is not part of the selection.

Unstack clears the anchors from the selection and every field drops back to exactly where it was designed. Anchoring never overwrites the position you dragged a field to, it only overrides it at render time, so unstacking always restores the original layout. Both gestures are a single undo step.

Reading the canvas

Three things on the canvas tell you what is anchored to what.

  • An amber anchor badge on a field's top left corner means it is anchored. Hover it to read what it hangs below and by how much.
  • Selecting an anchored field draws an amber dashed ring around its target.
  • A link line joins each anchored field to its target, labelled with the gap.

Link lines are drawn for the whole chain the selection belongs to, not just the one field you clicked, so selecting any field in a stacked block lights up the entire block.

When reflow gives up

If the resolved layout would not be a valid page, PatronSend abandons reflow for the whole document and renders every field at its designed position instead. That is deliberate. A page that is half reflowed is a layout nobody designed and nobody approved, and a receipt is not the place to improvise.

It gives up when a field:

MessageWhat happened
would overlap another fieldThe reflowed field would land on top of something else
would run off the pageThe reflowed field would end up above the top edge or past the bottom
could not be measuredThe text could not be measured, usually a font that failed to load
has an anchor that cannot be resolvedThe anchor points at a field that is no longer on the page, or at a loop

Nothing here blocks you from saving, and nothing produces a broken receipt. The worst case is a receipt that looks the way it looked before you anchored anything.

Preview mode tells you when it has happened. A line under the toolbar reads "Layout fell back to designed positions", and the amber warnings chip beside it lists which field and why. See Preview and testing for how to find the cases that only show up for donors you are not looking at.