I’d like to request conditional rendering support for tokens in page templates.
The problem
Tokens like {@arranger@} render as empty when the field is not filled in — which is fine. However, there’s no way to conditionally show or hide surrounding text (like a label, prefix, or line break) based on whether a field is populated.
Example: I want my first-page template to show this when an arranger is present:
John Williams
arr. Frank Sinatra
…and only this when the arranger field is empty:
John Williams
Currently this is impossible with a single template, because any static text — including line breaks — around a token is always rendered, regardless of whether the token resolves to anything.
Workarounds and why they fall short
- Putting “arr.” inside the Project Info field conflates data with presentation
- Creating separate page template variants per use case doesn’t scale — especially across a library of reusable templates
Proposed solution
Introduce a conditional block syntax, for example:
{@if:arranger@} … {@endif@}
Everything between these tags would only render when the referenced field is non-empty. A negated form could also be useful:
{@ifnot:arranger@} … {@endif@}
Crucially, the conditional should be able to wrap not just text and tokens, but also formatting elements like line breaks. A practical example:
{@composer@}{@if:arranger@}<newline>arr. {@arranger@}{@endif@}
This would render as composer + newline + "arr. " + arranger when the arranger field is filled in, and as just composer when it is not — with no trailing newline.
Use cases
- Arranger, lyricist, dedicatee — fields that are often optional
- Custom “Other Information” fields
- Any label or prefix that should only appear alongside actual content
- Line breaks between stacked contributor lines
This kind of conditional logic is standard in mail merge systems and templating engines, and would make Dorico’s token system significantly more powerful for professional template design. A single page template could then cleanly handle projects with and without optional contributors — without manual intervention or layout overrides.