Tuesday, June 2, 2015

Tutorial: Creating a Sitecore 8 Website Part 3 - Item Creation

Introduction

Now that we have defined templates for both content pages and travel destinations in part 2, we can utilise these templates to create content items. At this step, these items will not actually render in the browser because we first have to design the layouts/sublayouts and then assign them to the item templates.


Creating the items

Log into Sitecore administration and load up the content editor. Select the main Content item and from the top menu select Configure and Assign (Insert Options). Select the ContentPage and Destination templates as the insert options for this item. 

Select the Home item under Content and from the top menu select Configure and then Change (Template). Now select the ContentPage template found in the TravelSite folder, you will get a message indicating that fields will be lost, click Next as these fields were from the default Sitecore template (not required).

Now we are going to create some simple content pages. Right click on the Content item and then Insert > ContentPage and give the item the name "About".  Under the Content field enter some HTML content (click Edit HTML) for the page, the title attribute has pre-populated from the standard values, however you will need to enter a description and keywords.

Do the same step as above for some other general content pages, I added 5 more content pages.

Now right click the destinations item and select Insert > Destination, give the destination the name of "Wellington". Enter some details like the following image (please note that for this tutorial we have used simple content types rather than lookups or selections for country and weather to keep things simple). 

Now enter some other destinations (with multiple countries). I have entered 7 destinations across New Zealand and Australia.

A Sitecore package of the items created, can be downloaded here. To install please see Using the package designer to sync Sitecore content between environments.

Next step

Now that the content has been defined, we can move onto Part 4: Layout and Sublayout File Creation. This will involve creating the layouts/sublayouts in Visual Studio. Part 5 will then cover adding these layouts/sublayouts into Sitecore and assigning them to the ContentPage and Destination templates - which should then make the site render in the browser.

No comments:

Post a Comment