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

  1. Content Template Variables & Helpers
    1. Handlebars Template Engine
      1. Basic Syntax
      2. Built-in Handlebars Helpers
    2. File List Variables
      1. File Object Structure
      2. Example Usage
    3. Custom Helper Functions
      1. Size Formatting Helpers
        1. Automatic Unit Selection
        2. Fixed Unit Helpers
      2. Time Formatting Helpers
        1. Component Helpers (Modular)
        2. Total Helpers
    4. Complete Variable Reference
      1. Custom Variables
      2. Built-in Variables
      3. File List Variables

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

    <!-- Always shows TB -->
    <!-- Always shows GB -->
    <!-- Always shows MB -->
    <!-- Always shows KB -->

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:

   <!-- Hours (0-∞) -->
   <!-- Minutes within hour (0-59) -->
   <!-- Seconds within minute (0-59) -->
  <!-- Remaining milliseconds (0-999) -->

Custom Format Example:

Duration: ::.

Input: 5410456 ms → Output: “Duration: 1:30:10.456”

Total Helpers

Get complete duration in a single unit:

  <!-- Total seconds -->
  <!-- Total minutes -->
  <!-- Total hours -->
 <!-- Total milliseconds -->

Usage Example:

Completed in  minutes

Input: 5410456 ms → Output: “Completed in 90 minutes”

Complete Variable Reference

Custom Variables

Create dynamic, user-editable fields by referencing undefined variables:

Quality: 
Source: 
Notes: 

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)

Copyright © 2024 NZB Flow. Distributed under MIT License.

This site uses Just the Docs, a documentation theme for Jekyll.