Creating Pages and Using the Layout Template
Creating a Contact Us Page
Let's create a page to display our contact details. For added functionality, you might consider replacing this page with a fully-fledged "Contact Us" form.
Here are some potential solutions:
Use Umbraco Forms (for non-developers): Umbraco offers an add-on called Umbraco Forms. This tool is ideal for users who aren’t programmers, as it allows editors to create custom forms. You can find more information and purchase the product on Umbraco.com.
Build Your Own Contact Form (for developers): If you prefer a custom solution, you can build your own contact form using Surface Controllers in Umbraco.
Creating the Document Type and Template
To create a content-only contact page in Umbraco, follow these steps:
Go to Settings.
Click on ... next to Document Types.
Select Create. The Create Document Type dialog opens.
Select Document Type with Template.
Select an Icon from the list of icons.
Click Submit.
Enter a Name. Let's call it Simple Content Page.
Let's add two fields with the following specifications:
GroupField NameAliasData TypeContent
Page Title
pageTitle
Textstring
Content
Body Text
bodyText
Rich Text Editor

Simple Content Page Template with Data Fields Click Save.
Go to Templates to view your Simple Content Page template that was created automatically with the Document Type.
Open the Simple Content Page template.
Select
Layout template: No layout\and choose the Layout template.Click Choose.
Add the following HTML after the closing
}.
Click Save.
Updating the Document Type Permissions
Now let's update the Document Type permissions to specifically add child nodes under the root content node.
To update the Document Type permissions:
Go to Settings.
Open the Homepage Document Type.
Go to the Structure tab.
Click Choose in the Allowed child node types.
Select Simple Content Page.

Allow child nodes in HomePage Click Choose.
Click Save.
Creating the content node
To create a content node:
Go to Content.
Select ... next to the Homepage node.
Click Create.
Select Simple Content Page.
Enter a name for the Document Type. Let's call it Contact Us.
Fill in details for the Page Title and Body Text.
Click Save and Publish.
Adding the Document Type Properties
To add the Document Type properties:
Go to Settings.
Expand the Templates folder from the Templating section.
Open the Simple Content Page template.
Scroll to the
<!-- Jumbotron, w title -->(around line 8) section and highlight the text“Umbraco Support”(around line 11).Click Insert and select Value.
Click Submit.
Select Document Type from the Choose field drop-down list.
Select Simple Content Page.
Click Choose.
Select pageTitle from the Simple Content Page drop-down list.
Click Submit.
Repeat the same process for the
<div class="container">tag:Highlight the content from the
<p>tag (around line 19) to the end of the</p>tag (around line 22).Click Insert and select Value.
Click Submit.
Select Document Type from the Choose field drop-down list.
Select Simple Content Page.
Click Choose.
Select bodyText from the Simple Content Page drop-down list.
Click Submit.
Click Save.
Viewing the Contact Us Page
To view the Contact Us Page:
Go to Content.
Navigate to the Contact Us page.
Go to the Info tab.
Click the link to view the page.

Viewing Contact Us Page
Using Document Type Properties from the Homepage
You may notice that the footer is now empty. The footer content from the Homepage node is not rendered.
To use the Document Type properties from the Homepage Document Type, do the following:
Go to Settings.
Expand the Templates folder from the Templating section.
Open the Layout template.
Highlight
@Model.Value("footerText")in the footer (around line 51).Click Insert and select Value.
Click Submit.
Select Document Type from the Choose field drop-down list.
Select Home Page.
Click Choose.
Select footerText field from the HomePage drop-down list.
Select Yes, make it recursive checkbox. This notifies Umbraco to look up the content tree if the field doesn't exist at the node level for the page requested.
Click Submit.
Click Save.
Reload the Contact Us page to view the content with the footer.
Last updated
Was this helpful?