Master Pages
Understand the ASP.NET master page hierarchy that defines Print Store page layouts.
Master pages are ASP.NET files (.master) that define the structural layout of storefront pages. Each master page contains HTML markup, server controls, and content placeholders that child pages fill with their specific content. Master pages form an inheritance hierarchy — specialized pages like product details extend base layouts like the sidebar display.
Master Page Hierarchy
The following diagram shows how master pages inherit from each other:
PrintnowDisplay.master (root)
├── PrintnowDisplaySingle.master (full-width, no sidebar)
├── PrintnowHomeDisplay.master (home page with sidebar)
└── PrintnowSidebarDisplay.master (non-home pages with sidebar)
├── CategoryOverview.master (main category page)
├── SubCategoryOverview.master (sub-category / product listing)
├── ProductDetails.master (individual product page)
└── Blog masters...Master Page Reference
| Master Page | Inherits From | Purpose |
|---|---|---|
PrintnowDisplay.master | — | Root layout defining the page shell: <html>, <head>, <body>, <form>, and all required server controls. Contains header, navigation, sidebar, main content area, and footer. |
PrintnowDisplaySingle.master | PrintnowDisplay | Full-width layout with no sidebar. Wraps cpMainContent in a col-md-12 container. Sidebar placeholder exists but is hidden. |
PrintnowHomeDisplay.master | PrintnowDisplay | Home page layout with sidebar. Used when the storefront's default (home) page needs a sidebar alongside the main content. |
PrintnowSidebarDisplay.master | PrintnowDisplay | Standard layout for non-home pages with a sidebar. Most category and product pages inherit from this. |
CategoryOverview.master | PrintnowSidebarDisplay | Displays a main product category with its sub-categories. Has access to Category data object with sub-categories, thumbnails, and start prices. |
CategoryOverview2.master | PrintnowSidebarDisplay | Alternate category layout. Use when you need a different visual treatment for certain categories. |
SubCategoryOverview.master | PrintnowSidebarDisplay | Displays a sub-category with product listing, calculator, and product browser. Supports category data, thumbnails, extended content, and the calculator component. |
SubCategoryOverview2.master | PrintnowSidebarDisplay | Alternate sub-category layout. |
ProductDetails.master | PrintnowSidebarDisplay | Individual product page with thumbnails, description, calculator, pricing table, tabs, tags, and related products. |
ProductDetails2.master | PrintnowSidebarDisplay | Alternate product detail layout. |
LandingPageView.aspx | PrintnowDisplay | Displays a landing page with CMS content and child item cards (categories, sub-pages, groups). Supports a custom Mustache template (landing-page.mustache) in the theme's page-templates/ folder. |
BlogHome.master | PrintnowDisplay | Blog home page displaying blog posts. |
BlogPost.master | PrintnowDisplay | Individual blog post page. |
BlogCategory.master | PrintnowDisplay | Blog category listing page. |
Master Page Directive Attributes
Master pages declare special attributes in their @Master directive that control data loading and component behavior:
<%@ Master Language="VB" MasterPageFile="~/PrintnowSidebarDisplay.master"
AutoEventWireup="false"
CodeBehind="CategoryOverview.master.vb"
Inherits="Printnow.CategoryLayout"
ThumbSize="500"
EnableCategoryData="True" %>| Attribute | Values | Description |
|---|---|---|
MasterPageFile | Path to parent master | Specifies which master page this page inherits from (e.g., ~/PrintnowSidebarDisplay.master). |
EnableCategoryData | True / False | When True, populates the Category data object with sub-categories, thumbnails, tags, tabs, and extended content. Used on CategoryOverview and SubCategoryOverview. |
ThumbSize | Integer (pixels) | Sets the maximum dimension for thumbnails loaded into the Thumbnails collections. Default varies by master page. |
CalculatorTemplate | Template name (e.g., "default") | Specifies which calculator template to load from the calculator/ folder. Maps to calculator/{name}.html. |
Content Placeholders
Master pages define ContentPlaceHolder controls that child pages and the PrintNow engine fill with content. Here are the standard placeholders:
| Placeholder | Location | Description |
|---|---|---|
cpHead | <head> | Additional styles, scripts, and meta tags injected into the page head. Should be the last tag in <head>. |
cpMainBody | <body> | The primary content area. On PrintnowDisplay.master, this is where all page content renders. |
cpTitleBar | <body> | Page title bar area. Rarely used directly but available for custom title sections. |
cpMainContent | Sidebar layouts | The main content column in sidebar layouts (used by PrintnowSidebarDisplay and its children). |
cpSideBar | Sidebar layouts | The sidebar column content. Can be made visible or hidden per master page. |
cpBannerContent | PrintnowDisplaySingle | Banner area above main content in the single-column layout. |
Category and Product Placeholders
CategoryOverview, SubCategoryOverview, and ProductDetails master pages expose additional placeholders for their specific content sections:
| Placeholder | Master Page(s) | Description |
|---|---|---|
CmsContent | Category, SubCategory | CMS-managed content for the category. |
SubCategoryList | CategoryOverview | Auto-generated list of sub-categories. |
SubCategoryLinks | CategoryOverview | Auto-generated sub-category navigation links. |
CmsTabContent | CategoryOverview | Tabbed CMS content sections. |
GetStartedButtons | CategoryOverview | Action buttons for the category (e.g., "Get Started"). |
Calculator | CategoryOverview, SubCategory | The pricing calculator component. |
Carousel | ProductDetails | Product image carousel. |
ProductName | ProductDetails | Auto-generated product name heading. |
UnitPriceLine | ProductDetails | Starting price display. |
ProductCmsContent | ProductDetails | Product-level CMS content. |
PricingContent | ProductDetails | Pricing-specific CMS content. |
PageCmsContent | ProductDetails | Page-level CMS content. |
MiniCalculator | ProductDetails | Compact calculator display. |
ProductTags | ProductDetails | Auto-generated product tag links. |
RelatedProducts | ProductDetails | Auto-generated related products section. |
Hiding Default Placeholders
When you build a custom layout using data properties (e.g., looping through Category.SubCategories yourself), you can hide the auto-generated placeholders by setting Visible="False":
<%-- Hide auto-generated content, use custom layout instead --%>
<asp:ContentPlaceHolder ID="SubCategoryList" runat="server" Visible="False" />
<asp:ContentPlaceHolder ID="CmsTabContent" runat="server" Visible="False" />This is a common pattern — hide the default rendering and replace it with your own markup using the data properties and object models.
Data Properties by Master Page
Different master pages expose different data objects for use in your templates:
| Master Page | Available Data |
|---|---|
| PrintnowDisplay.master | CategoryMenuEntry, Categories, Products |
| PrintnowHomeDisplay.master | Categories, Products |
| ProductDetails.master | Category, Product, Categories, Products |
| CategoryOverview.master | Category, Categories |
| SubCategoryOverview.master | Category, Categories, Product Browser |
See Data Properties for the full property and function reference.
Related Pages
- Theme Structure — How master page files fit into the theme folder layout
- Server Controls — Controls placed inside master page markup
- Data Properties — Properties and functions available in each master page
- Object Models — Data objects populated by EnableCategoryData on master pages
- Skeleton Reference — Annotated minimal PrintnowDisplay.master starting point