PrintNowPrintNowDocs
Themes

Data Properties

Reference for global properties and functions available in Print Store theme master pages.

Print Store master pages expose server-side properties and functions that you can use in ASP.NET inline expressions (<%= %> and <% %>). These let you access storefront data directly in your theme markup — customer information, page state, categories, and products.

Global Properties

These properties are available on most master pages (all except blog-related masters). Use them with inline expression syntax.

PropertyTypeDescriptionExample
IsHomePageBooleanReturns True when the current page is the storefront home page.<% If IsHomePage Then %>
IsLoggedInBooleanReturns True when a customer is authenticated.<% If IsLoggedIn Then %>
CustomerUsernameStringThe logged-in customer's username.<%= CustomerUsername %>
CustomerEmailStringThe logged-in customer's email address.<%= CustomerEmail %>
CustomerFirstNameStringThe logged-in customer's first name.<%= CustomerFirstName %>
CustomerLastNameStringThe logged-in customer's last name.<%= CustomerLastName %>
SupportEmailStringThe storefront's support email address configured in settings.<%= SupportEmail %>

Conditional Rendering Examples

Show different content based on page type:

<% If IsHomePage Then %>
    <div class="hero-banner">
        <h1>Welcome to Our Store</h1>
    </div>
<% Else %>
    <pn:Breadcrumb ID="breadcrumb1" runat="server" />
<% End If %>

Show different content based on authentication:

<% If IsLoggedIn Then %>
    <span>Welcome, <%= CustomerFirstName %>!</span>
    <a href="/my-account">My Account</a>
<% Else %>
    <a href="/login.aspx">Sign In</a>
    <a href="/register.aspx">Create Account</a>
<% End If %>

Global Functions

These functions are available on most master pages and return data you can use to build navigation, category menus, and product displays.

PageLink(pageId As Integer) As String

Returns the URL for a CMS page by its ID. Use this to generate links to specific pages.

<a href="<%= PageLink(123) %>">Contact Us</a>

AllCategories

AllCategories(Optional alphaSort As Boolean = False) As List(Of CategoryMenuEntry)

Returns all available categories as a list of CategoryMenuEntry objects. By default, categories are sorted by their display order. Set alphaSort=True for alphabetical sorting.

<ul class="nav">
<% For Each cat In AllCategories() %>
    <li>
        <a href="<%= cat.Url %>"><%= cat.Name %></a>
        <% If cat.Children IsNot Nothing AndAlso cat.Children.Count > 0 Then %>
        <ul>
            <% For Each child In cat.Children %>
            <li><a href="<%= child.Url %>"><%= child.Name %></a></li>
            <% Next %>
        </ul>
        <% End If %>
    </li>
<% Next %>
</ul>

CategoriesByTag

CategoriesByTag(tag As String, Optional alphaSort As Boolean = False) As List(Of CategoryMenuEntry)
CategoriesByTag(tags As IEnumerable(Of String), Optional alphaSort As Boolean = False) As List(Of CategoryMenuEntry)

Returns categories matching a specific tag or set of tags. When multiple tags are provided, only categories matching all specified tags are returned.

<%-- Featured categories --%>
<% For Each cat In CategoriesByTag("featured") %>
    <div class="featured-category">
        <a href="<%= cat.Url %>">
            <img src="<%= cat.Thumbnails(0).Generate(300, 300, "fill") %>" alt="<%= cat.Name %>" />
            <h3><%= cat.Name %></h3>
        </a>
    </div>
<% Next %>

TagHasCategories

TagHasCategories(tag As String) As Boolean

Returns whether any available categories exist for a given tag. Use this to conditionally show sections.

<% If TagHasCategories("best-seller") Then %>
    <h2>Best Sellers</h2>
    <% For Each cat In CategoriesByTag("best-seller") %>
        ...
    <% Next %>
<% End If %>

ProductsByTag

ProductsByTag(tag As String, Optional alphaSort As Boolean = False)
ProductsByTag(tags As IEnumerable(Of String), Optional alphaSort As Boolean = False)

Returns products matching a specific tag or set of tags. Works similarly to CategoriesByTag but returns product objects.

<% For Each prod In ProductsByTag("new-arrival") %>
    <div class="product-card">
        <a href="<%= prod.DetailUrl %>">
            <img src="<%= prod.Thumbnails(0).Generate(250, 250, "fill") %>" alt="<%= prod.Name %>" />
            <h4><%= prod.Name %></h4>
        </a>
    </div>
<% Next %>

GetLandingPages

GetLandingPages(Optional alphaSort As Boolean = False) As List(Of LandingPageEntry)

Returns all published top-level landing pages (those not nested as children of another landing page). By default, pages are returned in database order. Set alphaSort=True for alphabetical sorting by name.

Use this to add landing pages to your site navigation or build a custom landing page directory.

<ul class="landing-pages-nav">
<% For Each lp In GetLandingPages() %>
    <li>
        <a href="<%= lp.Url %>">
            <img src="<%= lp.Thumbnail.Url %>?width=100&height=100" alt="<%= lp.Name %>" />
            <%= lp.Name %>
        </a>
    </li>
<% Next %>
</ul>

Data Availability by Master Page

Not all master pages have access to the same data. The table below shows which data objects and collections are available on each master page:

Master PageAvailable Data
PrintnowDisplay.masterCategoryMenuEntry (via AllCategories), Categories, Products
PrintnowHomeDisplay.masterCategories, Products
CategoryOverview.masterCategory object (current category with sub-categories)
SubCategoryOverview.masterCategory object, Product Browser component
ProductDetails.masterCategory object, Product object (with thumbnails, tags, related products)

Category and product data properties require EnableCategoryData="True" in the master page directive to be populated.

  • Object Models — Detailed reference for the objects returned by these functions
  • Master Pages — Which master pages expose which data properties
  • Server Controls — ASP.NET controls that work alongside inline data expressions
  • Page Templates — Mustache templates that consume similar data variables
  • Landing Pages — Configure the pages returned by GetLandingPages()

On this page