Certain master pages have new data properties which can be used to build completely custom layouts on those master pages.
Item
Description
PrintNowDisplay.master
CategoryMenuEntry, Categories, Products
PrintNowHomeDisplay.master
Categories, Products
ProductDetails.master
Categories, Products
CategoryOverview.master
Categories
SubCategoryOverview.master
Categories 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.
(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 True
See 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.
<% 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 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).
<!-- 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 %>" />
<!-- for CategoryOverview/SubCategoryOverview --><% If Category.HasExtendedContent("Paper&Specs") Then %> <h4>Paper & Specs</h4> <%= Category.ExtendedContent("Paper&Specs") %><% End If %>
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)
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.
<!-- 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 %>
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.
<!-- 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 %>" />
<!-- for ProductDetails --><% If Product.HasExtendedContent("ExtendedContent-Name") Then %> <h4>Paper & Specs</h4> <%= Product.ExtendedContent("ExtendedContent-Name") %><% End If %>
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.
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".
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.
(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.
<!-- 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 %>