PrintNowPrintNow

Page Variables

Master page and template variables for building custom Print Store layouts

Master Pages

Certain master pages have new data properties which can be used to build completely custom layouts on those master pages.

ItemDescription
PrintNowDisplay.masterCategoryMenuEntry, Categories, Products
PrintNowHomeDisplay.masterCategories, Products
ProductDetails.masterCategories, Products
CategoryOverview.masterCategories
SubCategoryOverview.masterCategories or Product Browser

In addition to the above mentioned changes most of the master pages (all but those related to blog) and CMS content now also include some new properties and functions which can be used in ASP.NET inline expressions.

Properties

ItemDescriptionCode
IsHomePageAs Boolean<% IsHomePage %>
IsLoggedInAs Boolean<% If IsLoggedIn Then %>
<div>logged in</div>
<% Else %>
<div>not logged in</div>
<% End If %>
CustomerUsernameAs String<% CustomerUsername %>
CustomerEmailAs String<% CustomerEmail %>
CustomerFirstNameAs String<% CustomerFirstName %>
CustomerLastNameAs String<% CustomerLastName %>
SupportEmailAs String<% SupportEmail %>

Functions

ItemDescriptionCode
PageLink(pageId As Integer) As String - Returns the url for a particular page based on the page id.<a href="<%= PageLink(123) %>">Link to page</a>
AllCategories(Optional alphaSort As Boolean = False) As List(Of CategoryMenuEntry) - Returns all available categories as a List(Of CategoryMenuEntry). List will be sorted by display order by default but can be sorted alphabetically by setting the alphaSort parameter to TrueSee code example below
CategoriesByTag(tag As String, Optional alphaSort as Boolean = False) As List(Of CategoryMenuEntry) - Returns all available categories that match the specified tag as a List(Of CategoryMenuEntry).See code example below
CategoriesByTag(tags As IEnumerable(Of String), Optional alphaSort as Boolean = False) As List(Of CategoryMenuEntry) - Returns all categories matching all specified tags.See code example below
TagHasCategories(tag As String) As Boolean - Returns whether or not there are available categories that match the specified tag.See code example below

AllCategories Example

<% Dim allCats = AllCategories(True) %>
<% If allCats IsNot Nothing AndAlso allCats.Count > 0 Then %>
<li class="dropdown">
    <a class="dropdown-item dropdown-toggle" href="/products">Products</a>
    <ul class="dropdown-menu">
        <% For Each entry in allCats %>
            <% If entry.Children Is Nothing OrElse entry.Children.Count = 0 Then %>
            <li>
                <a class="dropdown-item" href="<%= entry.Url%>"><%= entry.Name %></a>
            </li>
            <% Else %>
            <li class="dropdown-submenu">
                <a class="dropdown-item" href="<%= entry.Url%>"><%= entry.Name %></a>
                <ul class="dropdown-menu">
                    <% For Each subentry in entry.Children %>
                        <li>
                            <a class="dropdown-item" href="<%= subentry.Url%>"><%= subentry.Name %></a>
                        </li>
                    <% Next %>
                </ul>
            </li>
            <% End If %>
        <% Next %>
    </ul>
</li>
<% End If %>

CategoriesByTag Example (Single Tag)

<% Dim bestSellers = CategoriesByTag("best-seller", True) %>
<h4>Top Sellers</h4>
<div class="row">
<% For Each cat in bestSellers %>
    <div class="col-md-3">
        <a href="<%= cat.Url %>">
            <%= cat.Name %>
        </a>
    </div>
<% Next %>
</div>

CategoriesByTag Example (Multiple Tags)

<% Dim mktgBestSellers = CategoriesByTag({"marketing", "best-seller"}) %>
<h4>Tagged Marketing, Best Sellers</h4>
<div class="owl-carousel owl-theme" data-plugin-options="{'margin':11}">
<% For Each cat in mktgBestSellers %>
    <a href="<%= cat.Url %>">
        <div class="card">
            <img src="/catthumb.ashx?c=<%= cat.Id %>&w=500&h=500&fwnb=false" alt="product" class="card-img-top">
            <div class="card-body">
                <h5 class="card-title">
                    <%= cat.Name %>
                </h5>
            </div>
        </div>
    </a>
<% Next %>
</div>

TagHasCategories Example

<% If TagHasCategories("best-seller") Then %>
    <!-- this block will only render if the tag "best-seller" has available categories -->
    <% Dim bestSellers = CategoriesByTag("best-seller") %>
    <h4>Best Sellers</h4>
    <div class="row">
    <% For Each cat in bestSellers %>
        <div class="col-md-4">
            <a href="<%=cat.Url %>"><%= cat.Name %></a>
        </div>
    <% Next %>
    </div>
<% End If %>

CategoryEntry

CategoryEntry is an object representing the target (or viewed) category. The only thing to note is that the SubCategories property will always contain the available sub-categories for the current category unless the current category is a child category. In this case the SubCategories property will contain all available sub-categories that are siblings of this category (that list will include this category as well).

Properties

ItemDescriptionCode
IdAs Integer
NameAs String<%= Category.Name %>
DescriptionAs String<%= Category.Description %>
ContentAs String<%= Category.Content %>
SubCategoriesAs List(Of SubCategoryEntry)
TagsAs List(Of String)Requires Loop
TabsAs List(Of TabEntry)Requires Loop
ThumbnailsAs List(Of ThumbnailEntry)See code example below
PageContentAs String<%= Category.PageContent %>
PricingContentAs String<%= Category.PricingContent %>
StartPriceAs String<%= Category.StartPrice %>

Category Thumbnails Example

<!-- Category Thumbnails: for each loop -->
<% For Each thumbnail In Category.Thumbnails %>
    <img src="<%= thumbnail.Url %>" alt="<%= thumbnail.AltText %>" />
<% Next %>

<!-- Category Thumbnails: for loop -->
<% For Each i As Integer = 0 To Category.Thumbnails.Count - 1 %>
    <img src="<%= Category.Thumbnails(i).Url %>" alt="<%= Category.Thumbnails(i).AltText %>" />
<% Next %>

<!-- Category Thumbnails: specific thumbnail -->
<img src="<%= Category.Thumbnails(0).Url %>" alt="<%= Category.Thumbnails(0).AltText %>" />

Functions

ItemDescriptionCode
ExtendedContent(key As String) As String - Returns the requested extended content as a string.<%= Category.ExtendedContent("Paper&Specs") %>
HasExtendedContent(key As String) As Boolean - Returns whether or not the requested extended content exists.See code example below

HasExtendedContent Example

<!-- for CategoryOverview/SubCategoryOverview -->
<% If Category.HasExtendedContent("Paper&Specs") Then %>
    <h4>Paper &amp; Specs</h4>
    <%= Category.ExtendedContent("Paper&Specs") %>
<% End If %>

ProductsByTag

Returns all available products that match all the specified tags as a List(ProductsByTag). The first parameter is the tag or tags and is required. The second parameter is a true/false value for sorting alphabetically, the default is false.

  • Get products by a single tag: ProductsByTag("tag_name", false)
  • Get products by multiple tags: ProductsByTag({"tag_name_1","tag_name_2"}, false)

Example

<h4>My Tagged Products</h4>
<div class="masonry-loader masonry-loader-showing">
    <div class="row products product-thumb-info-list" data-plugin-masonry data-plugin-options="{'layoutMode': 'fitRows'}">
        <% For Each p In ProductsByTag("TAG_NAME_HERE") %>
            <div class="col-12 col-sm-6 col-lg-3 product">
                <span class="product-thumb-info border-0">
                <a href="<%= p.ActionUrl %>" class="add-to-cart-product bg-color-primary">
                    <span class="text-uppercase text-1">
                        <%= If(p.Customizable, "Customize", "Add to Cart") %>
                    </span>
                </a>
                <a href="<%= p.ActionUrl %>">
                    <span class="product-thumb-info-image">
                        <img alt="<%= p.Thumbnails(0).AltText %>" class="img-fluid" src="<%= p.Thumbnails(0).Url %>">
                    </span>
                </a>
                <span class="product-thumb-info-content product-thumb-info-content pl-0 bg-color-light">
                    <a href="<%= p.DetailsUrl %>">
                        <h4 class="text-4 text-primary"><%= p.Name %></h4>
                        <span class="price">
                            <del><span class="amount">$325</span></del>
                            <ins><span class="amount text-dark font-weight-semibold">$299</span></ins>
                        </span>
                    </a>
                </span>
                </span>
            </div>
        <% Next %>
    </div>
</div>

Properties

ItemDescriptionCode
IdAs Integer
NameAs String<%= p.Name %>
DescriptionAs String<%= p.Description %>
TagsAs List(Of String)Requires Loop
ThumbnailsAs List(Of ThumbnailEntry)<%= p.Thumbnails(0).AltText %>
<%= p.Thumbnails(0).Url %>
DisplayOrderAs Integer
DetailUrlAs String<%= p.DetailUrl %>
ActionUrlAs String<%= p.ActionUrl %>
CustomizableAs Boolean<%= p.Customizable %>

CategoryMenuEntry

CategoryMenuEntry is an object representing a category for use in a menu system. Using these objects you can dynamically build a menu hierarchy containing only categories available to the currently logged in user.

Example

<!-- Categories: nested dropdown menu for PrintNowDisplay.master -->
<% If Categories IsNot Nothing AndAlso Categories.Count > 0 Then %>
<li class="dropdown">
    <a class="dropdown-item dropdown-toggle" href="/products">Products</a>
    <ul class="dropdown-menu">
        <% For Each parent_category in Categories %>
            <% If parent_category.Children Is Nothing OrElse parent_category.Children.Count = 0 Then %>
            <li>
                <a class="dropdown-item" href='<%= parent_category.Url%>'><%= parent_category.Name %></a>
            </li>
            <% Else %>
            <li class="dropdown-submenu">
                <a class="dropdown-item" href='<%= parent_category.Url%>'><%= parent_category.Name %></a>
                <ul class="dropdown-menu">
                    <% For Each sub_category in parent_category.Children %>
                        <li>
                            <a class="dropdown-item" href='<%= sub_category.Url%>'><%= sub_category.Name %></a>
                        </li>
                    <% Next %>
                </ul>
            </li>
            <% End If %>
        <% Next %>
    </ul>
</li>
<% End If %>

Properties

ItemDescriptionCode
IdAs Integer
NameAs String
UrlAs String
DescriptionAs String
ChildrenAs List(Of CategoryMenuEntry)
ThumbnailsAs List(Of ThumbnailEntry)
StartPriceAs String

ProductEntry

ProductEntry is an object for representing a product and its associated data for use on the product details page. This object is designed to allow for a completely custom layout/design on a product's view details page.

Properties

ItemDescriptionCode
IdAs Integer
NameAs String
DescriptionAs String<%= Product.Description %>
ContentAs String<%= Product.Content %>
TagsAs List(Of ProductTagEntry)
RelatedAs List(Of RelatedProductEntry)
ThumbnailsAs List(Of ThumbnailEntry)See code example below
PageContentAs String<%= Product.PageContent %>
PricingContentAs String<%= Product.PricingContent %>

Product Thumbnails Example

<!-- Product Thumbnails: for each loop -->
<% For Each thumbnail In Product.Thumbnails %>
    <img src="<%= thumbnail.Url %>" alt="<%= thumbnail.AltText %>" />
<% Next %>

<!-- Product Thumbnails: for loop -->
<% For Each i As Integer = 0 To Product.Thumbnails.Count - 1 %>
    <img src="<%= Product.Thumbnails(i).Url %>" alt="<%= Product.Thumbnails(i).AltText %>" />
<% Next %>

<!-- Product Thumbnails: specific thumbnail -->
<img src="<%= Product.Thumbnails(0).Url %>" alt="<%= Product.Thumbnails(0).AltText %>" />

Functions

ItemDescriptionCode
ExtendedContent(key As String) As String - Returns the requested extended content as a string.<%= Product.ExtendedContent("ExtendedContent-Name") %>
HasExtendedContent(key As String) As Boolean - Returns whether or not the requested extended content exists.See code example below

HasExtendedContent Example

<!-- for ProductDetails -->
<% If Product.HasExtendedContent("ExtendedContent-Name") Then %>
    <h4>Paper &amp; Specs</h4>
    <%= Product.ExtendedContent("ExtendedContent-Name") %>
<% End If %>

ProductTagEntry

ProductTagEntry is an object representing a particular product tag. These objects can be used to dynamically build a products tag navigation/display.

Properties

ItemDescriptionCode
NameAs String
UrlAs String

RelatedProductEntry

RelatedProductEntry is an object representing a link to another product. These objects can be used to build completely custom "You might also be interested in" components.

Properties

ItemDescriptionCode
IdAs Integer<%= prod.Id %>
NameAs String<%= prod.Name %>
UrlAs String<%= prod.Url %>
CategoryAs String<%= prod.Category %>

SubCategoryEntry

SubCategoryEntry is an object representing a sub-category on a category (or sub-category) overview page. It is useful for displaying a list of sub-categories where one of those sub-categories is displayed as "active".

Properties

ItemDescriptionCode
IdAs Integer
NameAs String
DescriptionAs String
UrlAs String
ThumbnailsAs List(Of ThumbnailEntry)
StartPriceAs String

TabEntry

TabEntry is an object representing a tab as defined in the CMS system. You can use these to dynamically build a tab control or otherwise display the tab content as you see fit.

Properties

ItemDescriptionCode
TitleAs String
ContentAs String

ThumbnailEntry

ThumbnailEntry is an object representing a product or category thumbnail.

Properties

ItemDescriptionCode
UrlAs String<%= subcat.Url %>
AltTextAs String<%= subcat.Alt %>

Functions

ItemDescriptionCode
Generate(width As Integer?, height As Integer?, fit As String, borderWidth As Integer?, borderColor As String) As String - Returns a generated url for the ThumbnailEntry using the specified parameters. All parameters are optional. Possible values for fit are "fill", "center", "trim" and "stretch" with "center" being the default. Fit modes only apply when both width and height are specified.See code example below
RawReturns the raw thumbnail URL<img alt="" class="img-fluid" src="<%= thumb.Raw() %>">

Generate Example

<!-- Category Page -->
<% For Each thumb in Category.Thumbnails %>
    <%= thumb.Generate(400, 400, "fill") %>
<% Next %>

<!-- Product Detail -->
<%= Product.Thumbnails(0).Generate(560, 560, "fill") %>

<!-- Product Detail Related Product -->
<% For Each prod in Product.Related %>
    /thumbnails/p/<%= prod.Id %>?width=280&height=280&fit=fill
<% Next %>

Page Templates

A set of template files on the root of a PrintNow theme that allow further customization on set pages and controls.

calculator

A template used for the calculator on SubCategoryOverview.master, ProductDetails.master and for Custom Upload modal pop up.

VariableDescription
{{ data.SizeText || ("QuoteCalculator_Size_Text" | translate) }}Label used for size
{{ standardSize(calc.sizeId) }}Size selection
{{ "QuoteCalculator_Width_Text" | translate }}Width label used for custom size
{{ customSize(calc.customWidth) }}Width input used for custom size
{{ "QuoteCalculator_Height_Text" | translate }}Height label used for custom size
{{ customSize(calc.customHeight) }}Height input used for custom size
{{ "Inventory_InStock_Format" | translate:inventory.Quantity }}Inventory count value
{{ "QuoteCalculator_Quantity_Text" | translate }}Label used for quantity
{{ data.ColorText || ("QuoteCalculator_Color_Text" | translate) }}Label used for page count selector
{{ color(calc.colorId) }}Input used for page count selection
{{option.Name}}Label used for option group
{{o.Name}}Label used for option item
{{calc.spineSize}}Value used for calculating spine size
{{calc.pageCount - 4}}Page count used for # of pages
{{calc.coverDimensions.fmt_full}}Cover dimensions
{{calc.coverDimensions.fmt_trim}}Cover trimmed size
{{calc.pageDimensions.formatted}}Inside page dimensions
{{ "QuoteCalculator_Turnaround_Text" | translate }}Label used for Turnaround
{{productionDate}}Estimated production completion
{{ "QuoteCalculator_Total_Text" | translate }}Label used for total
{{ calc.total | money }}Total value
{{continueText}}Button used for Add-to-cart or customize on the product level
{{ "Download_Label_Text" | translate }}Label used for digital download option
{{ "Download_PrintOnly_Text" | translate }}Label used for print only option
{{ "Download_DownloadOnly_Text" | translate }}Label used for download only option
{{ "Download_DownloadPrint_Text" | translate }}Label used for download with print option
{{calc.quantityCount}}Variable data quantity used for mailings
{{ "QuoteCalculator_Save_Text" | translate }} {{ calc.discPercent }}%Unused totals for mailings
{{ -calc.discPrice | money }}Mailing total
{{ "QuoteCalculator_ImageFee_Text" | translate }}Label used for paid image licensing
{{ -calc.imageFee | money }}Value used for paid images
{{ "QuoteCalculator_EstimateShipping_Text" | translate}}Label used for estimate shipping
{{ "QuoteCalculator_Postal_Text" | translate }}Label used for postal code
{{ "QuoteCalculator_AddressType_Text" | translate }}Label used for address type
{{ "QuoteCalculator_Residential_Text" | translate }}Label used for residential option
{{ "QuoteCalculator_Commercial_Text" | translate }}Label used for commercial option
{{ "QuoteCalculator_Country_Text" | translate }}Label used for country
{{r.Name}}Name of Shipping option
{{r.Cost | money }}Cost of shipping option
{{ "QuoteCalculator_NoRates_Message" | translate }}Message used when no rates are found
{{ "QuoteCalculator_CloseButton_Text" | translate }}Label used for close button
{{ "QuoteCalculator_QuoteButton_Text" | translate }}Label used for get rates button
{{"Calculator_ProjectDetails_Text" | translate}} - {{data.Name}}Label used for title text
{{"Quote_ProjectName_Label" | translate}}Label used for project entry
{{allowedFileTypes}}Allowed file types to display
{{ "Quote_Finish_Button" | translate }}Label used to upload

product-browser

A set of templates for the main product browser and attributes used on the SubCategoryOverview.master.

Filter Variables

VariableDescription
{{filterPanel.labels.header}}Attributes Filter title label
{{cat.cat.Name}}Category name display label when using tag pages
({{cat.count}})Category count variable
{{filterPanel.labels.chosen}}Attribute group name
{{attr.name}}Attribute name
{{value.value}}Attribute value
{{filterPanel.labels.remove}}Remove text button
{{filterPanel.labels.narrow}}Narrow your results text label
{{group.name}}Attribute group name
{{item.value}}Attribute value
{{item.itemCount}}Attribute count

Grid Variables

VariableDescription
{{item.Name}}Product label name
{{item.ItemNumber}}Product item number
{{item.ModelNumber}}Product model number
{{item.Inventory}}Product inventory count
{{item.GetQuantity()}}Product default quantity
{{item.GetPrice() | money}}Product starting price
{{item.Url}}Product detail link
{{item.LinkText}}Product add-to-cart or customize
/thumbnails/p/{{item.Id}}?width=300&height=300Thumbnail URL
/offline-template.ashx?id={{item.SizeId}}Download template URL

Inline Variables

VariableDescription
{{item.Name}}Product label name
{{item.ItemNumber}}Product item number
{{item.ModelNumber}}Product model number
{{item.Inventory}}Product inventory count
{{item.GetQuantity()}}Product default quantity
{{item.GetPrice() | money}}Product starting price
{{item.Url}}Product detail link
{{item.LinkText}}Product add-to-cart or customize
/productthumb.ashx?p={{item.Id}}&w=300&h=300&bw=0&fwnb=falseThumbnail URL
/offline-template.ashx?id={{item.SizeId}}Download template URL

Product View Variables

VariableDescription
{{productView.labels.header}}Product Category Name
{{productView.products.length}}# of Products
{{productView.labels.results}}Filter selections taken from general settings
{{productView.labels.sortBy}}Sort by label name
{{productView.labels.sortDefault}}Sort by default using sort order
{{productView.labels.sortNameAsc}}Sort by A-Z label
{{productView.labels.sortNameDsc}}Sort by Z-A label
{{productView.labels.sortPriceAsc}}Sort by Low-High label
{{productView.labels.sortPriceDsc}}Sort by High-Low label
{{productView.labels.sortPop}}Sort by Popular
{{productView.labels.sortNew}}Sort by Newest
<%gridlist%>View by grid button
<%inline%>View by list button
{{$index + 1}}Page selection

my-account.mustache

A template used for the /my-account page.

VariableDescription
{{{ CmsContent }}}Contains the my-account CMS page content (must use triple brackets)
{{ UserFirstName }}User's first name
{{ UserLastName }}User's last name
{{ UserName }}User's username
{{ MyInfoTitle }}Account Information label
{{ MyInfoUrl }}URL to my-info page
{{ MyOrdersTitle }}Orders label
{{ #MyOrdersExist }}If exists show order account
{{ MyOrdersCount }}Number of orders
{{ MyOrdersUrl }}URL to my-orders page
{{ MyProjectsTitle }}Projects label
{{ #MyProjectsExist }}If exists show project count
{{ MyProjectsCount }}Number of projects
{{ MyProjectsUrl }}URL to my-projects page
{{ MyImagesTitle }}Images label
{{ #MyImagesExist }}If exists show image count
{{ MyImagesCount }}Number of images
{{ MyImagesUrl }}URL to my-images page
{{ MyApprovalsTitle }}Approvals label
{{ #MyApprovalsExist }}If exists show approval count
{{ MyApprovalsCount }}Number of approvals waiting
{{ MyApprovalsUrl }}URL to my-customer-approvals page

order-options.mustache

A template used for the /order-options page.

Notes:

  • Buttons/checkbox/textarea must all have the appropriate classes to be wired up automatically.
  • Button classes are custom-edit, custom-proof, custom-cancel, and custom-next.
  • The checkbox class is custom-approval and should be an input with type=checkbox.
  • The textarea class is custom-comments and should be a textarea.
  • For the next button, make sure the element is a button with type=submit.
VariableDescription
{{{PageContent}}}Contains the order options CMS page content (must use triple brackets)
{{ticks}}Used for the product thumbnail to ensure a new image is provided
{{ShowProof}}Show/hide download proof button
{{#NeedsApproval}}Show/hide approval checkbox
{{Id}}Product id, used for thumbnail URL
{{Name}}Product name
{{Description}}Product description
{{ItemNumber}}Product item number
{{ModelNumber}}Product model number
{{Comments}}Item comments
{{CanEdit}}Show/hide edit button
{{ShowComments}}Show/hide comments text box
{{{Calculator}}}Outputs markup to render the calculator (must use triple brackets)

products.mustache

A template used for the /products page.

VariableDescription
{{#category}}Category loop start
{{name}}Category name
/thumbnails/c/{{id}}?width=400&height=400&fit=fillCategory thumbnail URL
{{#subcategory}}Subcategory loop start
category.aspx?category={{id}}Category link URL

view-cart.mustache

A template used for the /view-cart page.

Notes:

  • Buttons must have the appropriate classes to be wired up automatically.
  • Button classes are custom-edit, custom-delete, custom-continue and custom-checkout.
  • The edit and delete buttons require the data-item attribute to know which item to edit/delete.

Example: <a href="#" class="custom-edit" data-item="{{ItemId}}">Edit</a>

Page Variables

VariableDescription
{{{PageContent}}}Contains the view cart CMS page content (must use triple brackets)
{{CartEmpty}}True/false, does cart contain items
{{Items}}List of cart items
{{Subtotal}}Shopping cart subtotal

Item Variables

VariableDescription
{{ItemId}}Shopping cart item id, used for edit/delete buttons
{{ProductId}}Product id, used for thumbnail
{{SKU}}Product item/SKU number
{{Model}}Product model number
{{Description}}Product description
{{Quantity}}Item quantity
{{Price}}Item price
{{Comments}}Item comments
{{IsDataList}}True/false, is item a data list
{{ListName}}Data list name
{{ListCount}}Data list record count
{{Category}}Product category
{{Name}}Product name
{{ProductType}}Product type (design online, custom upload, etc)
{{Options}}List of options, each has a Name and Value
{{ImageFee}}True/false, does item contain premium images

On this page