Computer Magic Logo
Add properties to the template

Wednesday, June 24, 2015

Published by Aristotelis Pitaridis

We created a template but the output of the template contains static information that we inserted in the template. Let’s see how to remove these static contents and replace them with dynamic data that we have defined in the Umbraco Back Office. We open the Template and the first information that we will transform to dynamic is going to be the title of the page.

We delete the phrase This is the title and we place the cursor inside the Title tag. Then we click the "Insert Umbraco page field" button.

A panel will appear on the screen which will allow us to select the property that we want to add to the Template.

We click on the Choose field drop down list and a list with all the fields will appear on the screen. 

We select the Alias name by clicking on it and the selection will be completed.

In order to insert the property in our template we have to click the Insert button which is located in the lower right corner of the page. The property will be added in the template and we can see it in the template editor.

We follow the same procedure for the other properties of the Document Type and we click the Save button which is located on the upper right corner of the screen.

If we visit again the home page we will see that the html which will be generated by Umbraco will contain the values that we typed in the properties. We can go and change these values and the next time that we will visit the page the new information will appear on the screen.