Content Template Variables & Helpers
Comprehensive reference for all built-in variables, custom helpers, and template syntax available in NZB Flow content templates.
Table of Contents
- Content Template Variables & Helpers
Handlebars Template Engine
Content templates use the Handlebars template language (also known as “mustache”) for dynamic content generation.
Basic Syntax
| Syntax | Purpose | Example |
|---|---|---|
| ` | Insert variable value |` | ||
| ` | Apply helper function |` | ||
| `` | Conditional blocks | ... |
| `` | Loop over arrays | ... |
Built-in Handlebars Helpers
All standard Handlebars helpers are available for advanced templating:
📚 Complete Handlebars Documentation
File List Variables
Several variables contain arrays of file objects that you can iterate over using ``.
File Object Structure
Each file object contains these properties:
| Property | Type | Description |
|---|---|---|
name |
string |
Filename with extension |
relativePath |
string |
Path relative to upload root folder |
absolutePath |
string |
Complete system path |
size |
number |
File size in bytes |
Example Usage
Custom Helper Functions
NZB Flow provides specialized helpers for formatting sizes and durations.
Size Formatting Helpers
Transform byte values into human-readable formats.
Automatic Unit Selection
Auto-selection rules:
- ≥ 1 TB → TB format
- ≥ 1 GB → GB format
- ≥ 1 MB → MB format
- ≥ 1 KB → KB format
- < 1 KB → bytes
Fixed Unit Helpers
Time Formatting Helpers
Convert millisecond values into readable time formats.
Input Format: All time variables represent duration in milliseconds
Component Helpers (Modular)
Extract specific time components for custom formatting:
Custom Format Example:
Input: 5410456 ms → Output: “Duration: 1:30:10.456”
Total Helpers
Get complete duration in a single unit:
Usage Example:
Input: 5410456 ms → Output: “Completed in 90 minutes”
Complete Variable Reference
Custom Variables
Create dynamic, user-editable fields by referencing undefined variables:
These become editable fields in task logs after upload completion.
Note: Block helpers like `` won’t work with custom variables and will render as empty.
Built-in Variables
These variables represent single values from the posting process:
Null Handling: Variables return empty strings when data isn’t available (e.g., RAR variables when compression is disabled).
| Variable | Type | Description |
|---|---|---|
jobname |
string \| null |
Post name/title |
fname |
string \| null |
Original file/folder name used as base |
raw_size |
number \| null |
Original file size before compression (bytes) |
rar_size |
number \| null |
Total RAR file size (bytes) |
rar_count |
number \| null |
Number of RAR files created |
rar_time |
number \| null |
RAR creation time (milliseconds) |
par_size |
number \| null |
Total PAR2 file size (bytes) |
par_count |
number \| null |
Number of PAR2 files created |
par_time |
number \| null |
PAR2 creation time (milliseconds) |
nyuu_size |
number \| null |
Total upload size: rar_size + par_size (or raw_size + par_size if no RAR) |
nyuu_time |
number \| null |
Upload duration (milliseconds) |
total_time |
number \| null |
Complete job duration including queue time (milliseconds) |
File List Variables
Arrays of file objects for iteration with ``:
| Variable | Type | Description |
|---|---|---|
raw_files |
TaskVariableFile[] |
Original files selected for posting (recursive) |
rar_files |
TaskVariableFile[] |
Generated RAR archive files |
par_files |
TaskVariableFile[] |
Generated PAR2 recovery files |
nyuu_files |
TaskVariableFile[] |
All files uploaded to usenet (rar_files or raw_files + par_files) |