Variables and Filters

There are variables and filters exposed to the templates that you have access to.



Metadata of the Pagedip being used in the render.

  • guid - the Pagedip's unique identifier

  • options - theme options for the Pagedip

  • title - the title of the Pagedip

  • handle - the URL handle

  • owner - the Pagedip owner's username


The page document being used in the render.

  • _id - The current page's unique identifier

  • title - The page title

  • path - The page's relative path from the Pagedip's base URL.

  • order - The order in which the page appears in the table of contents

  • options - Theme options set for this page


Metadata of this theme.

  • _id - The theme's unique identifier

  • title - The theme's title

  • handle - The theme's handle

  • description - A description of the theme

  • preview - Path to a preview Pagedip, shown when selecting a theme within Pagedip.

  • blueprint - Theme options that can be set on a page-to-page basis

  • globalBlueprint - Theme options set globally in the Pagedip's settings page

  • blockStyles - An array of custom styles for block elements


Metadata of this template.

  • _id - Template's unique identifier

  • cname - The templates's unique name

  • title - The template's title

  • filepath - The path the the template's source file

  • layout - The layout template that this template is rendered within

  • blueprint - Theme options for this template


An array of page documents for every page in the current Pagedip.


An array of content document for this page. This isn't necessary to use, as the render process will forcefully inject the contents into the proper pd-editable elements.

Each individual content document has the following fields:

  • _id - The content's unique identifier

  • name - The content name, pairs with the pd-editable field that it will be rendered into

  • value - the content's value

  • type - The content type


A function that returns the current Pagedip's url, which is distinctly different from the page's URL. You can pass additional path parts to the function to add them to the end. To get the current page's URL, use {{ getUrl(page.handle) }}.


A boolean signifying if the current environment is in the Pagedip editor or live. This can be helpful for WYSIWYG specific styling and content.

Theme and Template Options

All data from the theme, template, and embed blueprints are passed into the templates as variables. Properties on these objects can be accessed with dot notation or bracket syntax.

{{ options.options_group_name.option_name }}
{{ options["options_group_name"]["option_name"] }}

Nunjucks Filters


Converts a local asset name into the full URL. This is necessary for including assets in a template. The path given to file is relative to the assets directory set by the directories.assets field in the theme.json.


Wraps a URL in a <link> tag.


Wraps a URL in a <script> tag.

Example Usage:

  // wrap a URL in a <link> tag:
  {{ '' | style }}

  // wrap a URL in a <script> tag:
  {{ '' | script }}

  // convert local asset names into full URLs
  // and wrap them in a <script> or <link> tag:
  {{ 'main.css' | file | style }}
  {{ 'index.js' | file | script }}
  // convert local asset into full URL
  <img src="{{ 'images/my-image.png' | file }}" /> ... 

Nunjucks builtin filters are also available.