Page template |
Top Previous Next |
Now we get to the final step of this chapter: publishing computer specifications on your web site. Go to Visual Studio and choose to create a new ASPX page in folder CMSTemplates\MySite. Call the page ProductList.aspx and check the box Select master page:
Choose the CMSTemplates\MySite\MyMaster.master page on the next dialog:
Switch to the Design tab and you will see a preview of the page, including the inherited master page. Drag and drop the CMSBreadCrumbs and CMSDataList controls on the page:
Set the following properties of the controls:
CMSDataList
Switch to the code behind and add reference to the CMS.UIControls namespace:
[C#]
[VB.NET]
You also need to change the class definition so that it inherits from the TemplatePage class:
[C#]
[VB.NET]
Save all changes.
Now we need to register our new page template. Go to CMS Site Manager -> Development -> Page Templates and click My Web Site and click New template. Enter the following values:
Click OK. Enter the following values on the General tab:
Switch to the Sites tab and assign the template to your web site:
Now that we created the page template, we can start adding new pages based on this template. Go to CMS Desk -> Content, click the root and click New. Choose to create a new Page (menu item) and enter the following values:
Click Save.
Now we need to enter some computer details. Click /Products in the content tree and click New. Choose to create a new computer. Enter the following value:
Click Save and create another and enter:
Click Save.
Now, when you click /Products you will see a page like this:
When you click on some link, you will see computer details:
You have learned how to define a new document type and how to publish its documents on the web site.
|