Is this really the version you are looking for? Kentico Xperience 8.1 Tutorial is no longer updated. Use the switcher in the header to choose your product version.
This page describes how to create the product list page and publish computer specifications on the website.
Edit your web project in Visual Studio.
Right-click the CMSTemplates/MySite folder in the Solution Explorer and click Add -> Add New Item.
Create a Web Form named ProductList.aspx and check Select master page.
Click Add and choose the MyMaster.master page from the CMSTemplates/MySite folder.
Drag the following controls inside the <asp:Content> element of the product list page:
Set the properties of the CMSDataList control according to the table below:
Property | Value | Description |
|---|---|---|
ClassNames | custom.computer | Configures the datalist to display only pages of the custom.computer type. |
OrderBy | ComputerName ASC | Sets the SQL ORDER BY clause that the control uses when loading data. As a result, the control displays items in ascending alphabetical order based on the ComputerName values. |
TransformationName | custom.computer.preview | Assigns the transformation that the datalist uses to display the list of computer products. |
SelectedItemTransformationName | custom.computer.default | When a user selects a specific computer page on the website, the control displays the details according to the specified transformation. |
RepeatColumns | 2 | Configures the datalist to display 2 items per row in list mode. |
Switch to the code behind of the product list page (ProductList.aspx.cs) and add a reference to the CMS.UIControls namespace:
using CMS.UIControls;Change the class definition so that it inherits from the TemplatePage class:
public partial class CMSTemplates_MySite_ProductList : TemplatePageSave the files.
The source files of the products page are ready. Now you need to register the page template in Kentico.
Open the Pages application.
Select the root of the content tree (My website).
Click New ().
Choose the Page (menu item) page type.
Type in Products as the Page name and choose the Use existing page template option. Select the My website category and the Product list page template.
Click Save to create the page.
Select the Products page in the content tree.
Click New () and choose the Computer page type.
Fill in the computer page fields with the following values:
Click Save and create another and enter the following values:
Click Save.
If you view the /Products page in Preview mode, you can see a list of the two computer products (formatted according to the custom.computer.preview transformation).
When you click the title of a specific computer, the page displays the detail view (using the custom.computer.default transformation).