PrintNowPrintNowDocs
Themes

Page Templates

Reference for Mustache page templates that control the layout of key Print Store pages.

Page templates are Mustache HTML files stored in the page-templates/ folder of your theme. They control the layout and presentation of specific storefront pages — shopping cart, account dashboard, order options, and more. PrintNow renders these templates server-side, injecting data variables before sending the HTML to the browser.

Mustache Syntax

Page templates use Mustache syntax:

SyntaxDescriptionExample
{{ variable }}Output a value (HTML-escaped).{{ Name }}
{{{ variable }}}Output raw HTML (unescaped).{{{ CmsContent }}}
{{ #section }} ... {{ /section }}Conditional block — renders if value is truthy. Also used for loops over arrays.{{ #Items }} ... {{ /Items }}
{{ ^section }} ... {{ /section }}Inverted block — renders if value is falsy or empty.{{ ^CartEmpty }} ... {{ /CartEmpty }}
{{ . }}Current item in a loop or section.{{ #Comments }}{{ . }}{{ /Comments }}
{{ ! comment }}Comment — not rendered in output.{{ ! if cart is empty }}

my-account.mustache

Template for the My Account dashboard page (/my-account). Displays a welcome message and navigation cards for account sections.

Variables

VariableTypeDescription
CmsContentHTML (raw)CMS content configured for the My Account page. Use triple braces: {{{ CmsContent }}}
userfirstnameStringLogged-in customer's first name.
userlastnameStringLogged-in customer's last name.
usernameStringLogged-in customer's username.
MyOrdersTitleStringLabel for the orders section (translatable).
myordersurlStringURL to the orders page.
myorderscountNumberCount of customer orders.
MyOrdersExistBooleanTrue if the customer has orders. Use as section: {{ #MyOrdersExist }}
MyProjectsTitleStringLabel for the projects section.
myprojectsurlStringURL to the projects page.
myprojectscountNumberCount of saved projects.
MyProjectsExistBooleanTrue if the customer has saved projects.
MyImagesTitleStringLabel for the images section.
myimagesurlStringURL to the images page.
myimagescountNumberCount of uploaded images.
MyImagesExistBooleanTrue if the customer has uploaded images.
MyApprovalsTitleStringLabel for the approvals section.
myapprovalsurlStringURL to the approvals page.
myapprovalscountNumberCount of orders pending approval.
MyApprovalsExistBooleanTrue if the customer has pending approvals.
myinfourlStringURL to the account info page.

Example

<h4>Welcome, {'{{'} userfirstname {'}}'}!</h4>
{'{{{'} CmsContent {'}}}'}

<a href="{'{{'} myordersurl {'}}'}">
    My Orders
    {'{{'} #MyOrdersExist {'}}'}<span class="badge">{'{{'} myorderscount {'}}'}</span>{'{{'} /MyOrdersExist {'}}'}
</a>

view-cart.mustache

Template for the Shopping Cart page (/view-cart). Displays cart items with thumbnails, descriptions, quantities, pricing, and checkout actions.

Variables

VariableTypeDescription
CartEmptyBooleanTrue when the cart has no items. Use to show empty cart message.
PageContentHTML (raw)CMS content for the cart page.
SubTotalStringFormatted cart subtotal.
ItemsArrayArray of cart line items (see below).

Item Variables (inside {'{{'} #Items {'}}'})

VariableTypeDescription
ItemIdIntegerCart line item ID. Used by edit/delete buttons via data-item attribute.
ProductIdIntegerProduct ID. Used for thumbnail URLs.
NameStringProduct name.
CategoryStringParent category name.
DescriptionHTML (raw)Product description HTML.
QuantityStringOrder quantity.
PriceStringFormatted line item price.
ProductTypeStringProduct type label.
CommentsStringCustomer comments/notes for this item.
IsDataListBooleanTrue if this item is a data list (mailing list).
ListNameStringData list name (when IsDataList is true).
ListCountNumberNumber of records in the data list.
OptionsArraySelected product options. Each has Name and Value.
ImageFeeBooleanTrue if a premium image fee applies.

Required CSS Classes

The view cart template uses special CSS classes that PrintNow's JavaScript binds to for button actions:

CSS ClassAction
custom-deleteRemoves the cart item. Requires data-item="{{ ItemId }}" attribute.
custom-editOpens the item for editing. Requires data-item="{{ ItemId }}" attribute.
custom-checkoutProceeds to checkout.
custom-continueReturns to continue shopping.

order-options.mustache

Template for the Order Options page (/order-options). Displayed after file upload or editor, showing an order preview with the calculator, proof download, and approval checkbox.

Variables

VariableTypeDescription
PageContentHTML (raw)CMS content for the page.
IdIntegerProduct ID (used for thumbnail URL).
NameStringProduct name.
DescriptionStringProduct description.
CalculatorHTML (raw)Rendered pricing calculator. Use triple braces: {{{ Calculator }}}
CommentsStringExisting customer comments.
NeedsApprovalBooleanTrue if the product requires approval before production.
CanEditBooleanTrue if the item can be re-edited.
ShowProofBooleanTrue if a PDF proof is available for download.
ShowCommentsBooleanTrue if the comments field should be displayed.
ticksStringCache-busting timestamp for thumbnail URLs.

Required CSS Classes

CSS ClassAction
custom-editReturns to the editor to modify the design.
custom-proofDownloads the low-resolution PDF proof.
custom-approvalCheckbox input for order approval confirmation.
custom-commentsTextarea for customer comments/notes.
custom-cancelCancels and returns to the previous page.
custom-nextProceeds to the next checkout step.

products.mustache

Template for the All Products page (/products). Displays a grid of categories with their sub-category links and thumbnails.

Variables

VariableTypeDescription
categoryArrayArray of category objects to display.

Category Item Variables (inside {'{{'} #category {'}}'})

VariableTypeDescription
idIntegerCategory ID.
nameStringCategory display name.
subcategoryArrayArray of sub-categories, each with name and url.

Example

{'{{'} #category {'}}'}
<div class="col-md-6">
    <div class="card mb-4">
        <div class="card-header">{'{{'} name {'}}'}</div>
        <div class="card-body">
            <img src="/thumbnails/c/{'{{'} id {'}}'}?width=400&height=400&fit=fill" alt="{'{{'} name {'}}'}" class="img-fluid" />
            <ul>
            {'{{'} #subcategory {'}}'}
                <li><a href="{'{{'} url {'}}'}">{'{{'} name {'}}'}</a></li>
            {'{{'} /subcategory {'}}'}
            </ul>
        </div>
    </div>
</div>
{'{{'} /category {'}}'}

landing-page.mustache

Template for Landing Pages (/your-landing-page-url). Controls the layout of landing pages created in Content > Landing Pages. If this template exists in your theme's page-templates/ folder, it replaces the default card-based layout for all landing pages.

Variables

VariableTypeDescription
PageContentHTML (raw)CMS content configured for the landing page. Use triple braces: {{{ PageContent }}}
ChildrenArrayAll child items (categories, landing pages, and groups) sorted by display order. Each has name, url, thumbnail.url, and isGroup.
CategoriesArrayOnly the category-type children.
PagesArrayOnly the landing page-type children.
GroupsArrayOnly the group-type children. Each group has a nested children array containing its own categories and landing pages.

Child Item Variables (inside {'{{'} #Children {'}}'}, {'{{'} #Categories {'}}'}, {'{{'} #Pages {'}}'}, or group {'{{'} #children {'}}'})

VariableTypeDescription
nameStringDisplay name (category name, landing page title, or group name).
urlStringSEO-friendly URL to the category or landing page. Empty for groups.
thumbnail.urlStringThumbnail image URL. Append ?width=200&height=200 for sizing.
isGroupBooleanTrue if the item is a group container. Use {{ #isGroup }} / {{ ^isGroup }} for conditional rendering.
childrenArrayNested child items (only present on group items).

Example

{'{{{'} PageContent {'}}}'}

{'{{'} #Children {'}}'}
    {'{{'} #isGroup {'}}'}
    <div class="group-panel">
        <h4>{'{{'} name {'}}'}</h4>
        <div class="row">
            {'{{'} #children {'}}'}
            <div class="col-md-4">
                <a href="{'{{'} url {'}}'}">
                    <img src="{'{{'} thumbnail.url {'}}'}?width=200&height=200" alt="{'{{'} name {'}}'}" />
                    <span>{'{{'} name {'}}'}</span>
                </a>
            </div>
            {'{{'} /children {'}}'}
        </div>
    </div>
    {'{{'} /isGroup {'}}'}

    {'{{'} ^isGroup {'}}'}
    <div class="col-md-4">
        <a href="{'{{'} url {'}}'}">
            <img src="{'{{'} thumbnail.url {'}}'}?width=200&height=200" alt="{'{{'} name {'}}'}" />
            <span>{'{{'} name {'}}'}</span>
        </a>
    </div>
    {'{{'} /isGroup {'}}'}
{'{{'} /Children {'}}'}

upload.mustache

Template for the File Upload page. Controls the layout of the print-ready file upload interface. This is a larger template with variables for file handling, size selection, and upload progress. Customize the upload.mustache file in your theme's page-templates/ folder.

  • Theme Structure — Where page-templates/ fits in the theme folder layout
  • Calculator — The pricing calculator embedded in order-options.mustache
  • Page Content — Manage the CMS content injected into page template variables
  • Landing Pages — Configure landing pages rendered by landing-page.mustache

On this page