The inline segment {:inlinesegment segmentName} function lets you insert dynamic, reusable content directly inside a sentence or a table row - not just on its own separate line. This guide explains what it is, how to set it up with sub-template (aka configFile) and a main document template, and walks through a complete working example you can use as an example.
| What you’ll learn: what the inline segment function does and when to use it, how the two-file setup works, the exact syntax, a full worked example, and the rules that keep it error-free. |
1. What is the inline segment function?
A regular {:includesegment} function must sit on its own line, which it cannot share that line with other text or code syntax. That is fine for whole paragraphs, but it means you cannot drop a segment’s output into the middle of a sentence.
The {:inlinesegment} function on the other hand, removes that limit. It returns its result inline - right where you place it- so the output can appear mid-sentence or inside a table cell at the row level.
Why this matters:
- Insert a translated or computed value in the middle of a sentence, e.g. “John Doe is Président”. (the example here is not intended to display a full French translation, purely to illustrate how this new function is intended to be used)
- Use a segment’s output inside a table row, alongside other text.
- Keep the reusable logic in one central configFile, so the main template stays short and readable.
2. The building blocks
You will use five pieces. Keep these definitions handy as you read the walkthrough.
| Piece | What it is |
| {@assignmentNameASG = "…"} | Assignment (ASG): defines a variable or a filtered collection you can reuse. Convention: end the name with “ASG” to differentiate them from dxt regular variables |
| {:include subTemplateName} | Include: brings a sub-template into your main template. Place it at the very top. |
| {:inlinesegment segmentName} … {:inlinesegment/} | Defines an inline segment whose result can be inserted inline, this segment declaration lives in the sub-template. |
| {:includeinlinesegment segmentName} | Inserts the inline segment’s result inline, exactly where you type it. |
| {segmentName} | A name of a segment defined and being inserted must match exactly in both the main template and the sub-template. |
3. The two-file setup
You build two documents that work together:
1. The subtemplate / config file (ATH_configWordWithInlineSegment):
- defines a collection assignment that streamlines long syntax to within {collectionNameASG}
- the inline segment definition as {segmentName} that contains fuzzy code logic and statements
- holds {collectionName1ASG} that is being called upon from the main template
2. The main template (Main Template w include Segment Function via SubT):
- stores a syntax to include the sub-template;
- loops over a collection array that interated by {collectionNameASG} from the sub-template;
- declares a {collectionName1ASG} that lets the main template communicate with the inline {segmentName} that is connecting the {collectionNameASG} with its intended {segmentName};
- per-row segment connector syntax, and calls the inline segment inline.
| The connector, in plain terms: one variable ties the two files together. In this example it is activeOfficersGroupedASG — defined per row in the main template and read inside the inline segment. If the two names don’t match exactly, the title won’t appear. |
4. Step-by-step walkthrough
Step 1 — Build the subtemplate (config file)
Give it a descriptive name, e.g. ATH_configWordWithInlineSegment. Add two things.
a) The collection assignment — pull the officers once and group them, centrally:
| {@activeOfficersGroupASG = "((RES_affiliations) || (affiliations | status:'!inactive') | filter:'role':'Officer' | except:(tasks | grab:1:'outgoingAffiliations'):'affiliationID' | orderBy_B:'rank' | groupBy:'participant_profileID')"} |
This takes affiliations (or resolution affiliations), keeps active Officers, excludes anyone in the outgoing affiliations, orders them by rank, and groups them by participant so each person is one group.
b) The inline segment definition — translate the title:
| {:inlinesegment ATH_officerTitleFrenchTranslation}{#activeOfficersGroupedASG}{#type=='Secretary'}Secrétaire{/}{#type=='Treasurer'}Trésorier{/}{#type=='Chair'}Président{/}{#type=='Chief Executive Officer'}Directeur général{/}{/}{:inlinesegment/} |
It loops the per-row group (activeOfficersGroupedASG) and prints the French translation for each officer type. This demo covers four titles (Secretary, Treasurer, Chair, CEO); you would extend the list for full coverage.
| Keep it on one line: the entire {:inlinesegment …}{:inlinesegment/} definition should stay on a single line in your template. |
Step 2 — Build the main template
a) Include the config file at the very top:
| {:include ATH_configWordWithInlineSegment} |
This bridges the config file so its assignment and inline segment are available throughout the document. It must be at the top — if it sits lower, content above it cannot see the segment.
b) Loop, define the connector, and call the inline segment inline:
{#activeOfficersGroupASG} {@activeOfficersGroupedASG = "group | filter:'role':'Officer'"}{group | grab:1:'participant_fullName'} is {:includeinlinesegment ATH_officerTitleFrenchTranslation}{/} |
This loops each officer group, defines the per-row connector (activeOfficersGroupedASG), then prints the person’s full name, the word “is”, and the inline segment’s translated title — all on one line. Result: “John Doe is Président”.
| Tip: keep the {@activeOfficersGroupedASG = …} assignment on the same line as the output (as shown) so you don’t get a blank line before each officer. |
Step 3 — Upload and configure in Athennian
- Upload Files & Link: Upload the MS Word config file as a subTemplate. Then, upload the main template and attach the subTemplate in its settings to link them.
Add Syntax to Header: In the main template's header, create a text box and insert {include subTemplateName}.
Formatting Tips:
- Set the text box border to No Outline and resize it as small as possible.
- Optionally shrink the font size or set the font color to white. (Note: The final generated output inherits the main document's formatting, so font tweaks here won't impact the end result.)
- Anchor the text box in a consistent spot on the page so it’s easy to find when hovering.
SCREENSHOT: the template settings linking the subTemplate to the main template |
Step 4 — Generate and check
Generate the document (or preview the expected output) and confirm each officer’s title appears inline, within the surrounding text.
5. Worked example — Silent Hill Inc.
Seed data with four officers (one person signed twice with two different titles):
| Officer | Title(s) |
| Otto Struve | Secretary, CEO |
| Adrian Brooke | Treasurer |
| Carol Jimenez | Chair |
Expected output (each title populated inline):
- Otto Struve is Secrétaire Directeur général (two titles, currently back-to-back — see the limitation below)
- Adrian Brooke is Trésorier
- Carol Jimenez is Président
The key result: the translated title is populated inline — within the surrounding text, at the row level — which is exactly what the inline segment enables.
SCREENSHOT: the generated document showing officer titles populated inline |
6. Quick syntax reference
| Tag | Purpose |
| {@activeOfficersGroupASG = "…"} | The collection assignment, activeOfficersGroupASG, is defined here to keep the main template clean and readable instead of embedding this long syntax there. Because it lives in the subtemplate, any future fix can be made once in this one place, and every connected template picks up the update automatically |
| {:inlinesegment ATH_officerTitleFrenchTranslation}{#activeOfficersGroupedASG }{#type=='Secretary'}Secrétaire{/}{#type=='Treasurer'}Trésorier{/}{#type=='Chair'}Président{/}{#type=='Chief Executive Officer'}Directeur général{/}{/}{:inlinesegment/} | the inline segment is defined as ATH_officerTitleFrenchTranslation. This syntax lives in the sub-template and the key connector between the sub-template and the main template. The main template calls it inline using the includeinlinesegment tag, and it resolves to the officer title text. |
| {:include ATH_configWordWithInlineSegment} | Bridges a subtemplate into the main template. Place at the top of the main template, optional to place it in a text box. |
{#activeOfficersGroupASG} {@activeOfficersGroupedASG = "group | filter:'role':'Officer'"}{group | grab:1:'participant_fullName'} is {:includeinlinesegment ATH_officerTitleFrenchTranslation}{/} | Loop over a collection, or run a conditional block. The group assignment on the next line is the bridge that lets the main template communicate with the inline segment ATH_officerTitleFrenchTranslation, which is stored in the subtemplate. This per-iteration group must be defined here in the main template so the two stay in sync.
|
| Note: the logic above is the simplest way to test and learn how inlinesegment works in document coding. If a single participant holds multiple office titles — and those titles must print in Oxford-comma sentence format — additional conditional logic and more tailored syntax would be needed. Alternatively, we may implement a DXT enhancement to solve that challenge with a more robust approach. | |
7. Rules and tips (avoid common errors)
- Put the {:include …} tag at the very top of the main template.
- Keep the connector variable name identical in both files (here: activeOfficersGroupedASG).
- Keep the per-row assignment on the same line as its output to avoid extra blank lines.
- Do not put code, text, or numbers in the document’s header or footer — it can corrupt the template.
8. Current limitation
| Multiple titles per person: when one participant holds more than one office title (like Alta Struve above), the titles currently print back-to-back rather than in a clean Oxford-comma sentence (e.g. “Secrétaire, Trésorier et Président”). Formatting them that way needs additional tailored syntax and may be handled by a future enhancement. The core inline result is correct. |
9. Questions and support
If anything doesn’t populate as expected, first re-check the assignment and sub-template names, and the include syntaxes at the top. For further help, contact your document-automation team.