Skip to the content

How to Create a New Doc Type/Template And Page in Umbraco 8

Hey Guys, 

Ive just added my first Page to my Starter site and though it may be a good idea to write a blog helping you guye=s do this for the first time, and help out with any problems you may run into. 

So First off we want to create a new Doc Type, Follow these steps if you don't know how

Step 1. Log in to your umbraco 8 back office.

Step 2. Navigate to Document Types(Settings>Document Types) .

Step 3. Right Click on the Document Types Folder (or Click the 3 dots to the right of the folder) and then click Create.

Step 4.Choose "Document Type"(The First/Top option) Now Give your new Doc Type a Name and Description and start adding your groups and property's.

Step 5. Save and publish your Document. 

 

If you would like your Doc Type To be added as a page in your menu you need Allow permisions in the homepage Doc Type

Step 1. Navigate to the HomePage Doc Type (Settings>Document Types>Home>).

Step 2. Click Permissions in the top right of your screen (or Click the 3 key).

Step 3. Click Add Child in the "Allowed Child Nodes Types" Section and select your Doc Type.

 

Now you need to add your Doc Type to your Home Page and Start Adding Content

Step 1. Click Content and then Right click on Home in the content tree (or Click the 3 dots to the right of the tree item).

Step 2. Click Create and select your Doc Type.

Step 3. Give your new page a Name and fill out all the property fields for your Document Type. And Click Save and Publish.

 

Now your Content is added and your New page Should be a Menu item on your Home Page

You Now need to configure your template to display all your content on the front end 

(Templates are the Code your Doc type Need do Show all your Doc Types property to your actual Website)

(if when creating your Doc Type you chose create without template you will need to Create a Template and apply it to your doc type)

Step 1. Navigate the Templates Section and Choose the Template That is linked to your Doc Type.

Step 2. If your template is open you should now see some code on your page

Step 3. Now you need to render your Properties to the page using .NET code

Here is My Code Showing a Nav Bar and page title.

@inherits Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.FirstDocType>
@using ContentModels = Umbraco.Web.PublishedModels;
@{
Layout = "master.cshtml";
}
@Html.Partial("~/Views/Partials/SectionHeader.cshtml")
<section class="section">
 <div class="container">
 <div class="col-md-3">
<nav class="nav-bar nav-bar--list">
@Html.Partial("~/Views/Partials/Navigation/SubNavigation.cshtml")
</nav>
</div>
 <div class="col-md-9">
<article>
<h1>@Model.Value("pageTitleBackgroundImage", fallback: Fallback.ToAncestors)
@Model.Value("pageTitle")</h1>
</article>
</div>
</div>

</section>

* Be sure to make sure the ContentModels. is referencing to your Doctype Alias *

TIP: when referencing your Doc Type the first letter is Capitalized 

About the author

Nathan Reece

.Net MVC Developer | Umbraco Novice

Hey Guys,

I'm an New Developer with a passion for coding. I absolutely love working with Umbraco CMS and appreciate the Umbraco community even more.

I've got 3 years+ .Net experience and 5 years+ experience working in the Web Develepment industry, both coding and marketing job websites. I wanted to use my skills to help give something back to this awesome community and UmbraJobs.com seems like the right place to do just that.

Follow me on social media

If you're an Umbraco professional, partner, employer, recruiter or a passionate Umbraco community builder then I'm more than happy to hear from you. Follow me on my social media channels and please reach out if you have any needs, want help or consultation with anything Umbraco related or just want a general chat.

comments powered by Disqus

Blog Filter


How we can help?

Need help with an Umbraco project?

Need help with a project but not too sure who to approach? Send us your project brief and budget. We will provide a free consultation and can help you gather quotes from the best and most suitable freelancers or agencies.

Looking to hire an Umbraco Professional?

Have you got job vacancy and want to hire an Umbraco professional? Post a job on our website for free. Alternatively let us know your requirements and we will send suitable prospects your way.

Claim your free profile!

Are you an Umbraco Freelance Developer or Umbraco partner that wants to advertise on our site? If you work with Umbraco or registered as an Umbraco partner then you can create a profile for free.

Let's build the Umbraco Community

We're big on building the Umbraco community and we think you guys are awesome! If there's anyway at all we can help then please reach out.