Skip to content

Commit c5d6778

Browse files
authored
Update README.md
1 parent f13b3df commit c5d6778

File tree

1 file changed

+11
-11
lines changed
  • 14/umbraco-cms/fundamentals/design/templates

1 file changed

+11
-11
lines changed

14/umbraco-cms/fundamentals/design/templates/README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ description: Templating in Umbraco builds on the concept of Razor Views from ASP
44

55
# Templates
66

7-
Templates are the files that control the look and feel of the frontend of your Umbraco websites. Building on the concept of MVC Razor Views, template files enables you to structure your websites using HTML, CSS and JavaScript. When tied to a Document Type, templates are used to render your Umbraco content on the frontend.
7+
Templates are the files that control the look and feel of the frontend of your Umbraco websites. Building on the concept of MVC Razor Views, template files enable you to structure your websites using HTML, CSS, and JavaScript. When tied to a Document Type, templates are used to render your Umbraco content on the frontend.
88

9-
You can manage and work with your templates directly from the Settings section in the Umbraco backoffice. Each Template can also be found as `cshtml` files in the `Views` folder in your project directory.
9+
You can manage and work with your templates directly from the Settings section in the Umbraco backoffice. Each Template can also be found as a `cshtml` file in the `Views` folder in your project directory.
1010

1111
## Creating Templates
1212

13-
When you are building an Umbraco website you can choose to automatically generate Templates when you create a new Document Type. This will ensure the connection between the two and you can jump straight from defining the content to structuring it.
13+
When building an Umbraco website you can automatically generate Templates when you create a new Document Type. This will ensure the connection between the two and you can jump straight from defining the content to structuring it.
1414

1515
Choose the option called **[Document Type with Template](../../data/defining-content/README.md)** when you create a new Document Type to automatically create a Template as well.
1616

17-
In some cases, you might want to create independent Templates that doesn't have a direct connection to a Document Type. You can follow the steps below to create a new blank Template:
17+
In some cases, you might want to create independent Templates that don't have a direct connection to a Document Type. You can follow the steps below to create a new blank Template:
1818

1919
1. Go to the **Settings** section inside the Umbraco backoffice.
2020
2. Click **...** next to the **Templates** folder.
@@ -38,7 +38,7 @@ To use a Template on your content, you must first allow it on the content Docume
3838

3939
## Inheriting a Template
4040

41-
A Template can inherit content from what is called a "Master Template". This is done by using the ASP.NET views Layout feature.
41+
A Template can inherit content from a "Master Template". This is done by using the ASP.NET views Layout feature.
4242

4343
Let's say you have a Template called **MainView**, containing the following HTML:
4444

@@ -71,7 +71,7 @@ Follow these steps to use a Template file as a Master Template:
7171

7272
Alternatively, you can manually change the value of the `Layout` variable in the Template using the name of the Template file.
7373

74-
The updated markup will look something like the snippet below and the Template is now refered to as a *Child Template*:
74+
The updated markup will look something like the snippet below and the Template is now referred to as a *Child Template*:
7575

7676
```csharp
7777
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@@ -81,7 +81,7 @@ The updated markup will look something like the snippet below and the Template i
8181
<p>My content</p>
8282
```
8383

84-
When a page that uses a Template with a Master Template defined is rendered, the HTML of the two template is merged.
84+
When a page that uses a Template with a Master Template defined is rendered, the HTML of the two templates is merged.
8585

8686
The code from the Template replaces the `@RenderBody()` tag in the Master Template. Following the examples above, the final HTML will look like the code in the snippet below:
8787

@@ -101,7 +101,7 @@ The code from the Template replaces the `@RenderBody()` tag in the Master Templa
101101

102102
## Named Sections
103103

104-
Template Sections give you added flexibility when building your templates. Use the Template Section together with a Master Template setup, to decide where sections of content is placed.
104+
Template Sections give you added flexibility when building your templates. Use the Template Section together with a Master Template setup, to decide where sections of content are placed.
105105

106106
If a Child Template needs to add code to the `<head>` tag a Section must be defined and then used in the Master Template. This is made possible by [Named Sections](https://www.youtube.com/watch?v=lrnJwglbGUA).
107107
@@ -150,12 +150,12 @@ For instance, if you want to be able to add HTML to your `<head>` tags, you woul
150150
</html>
151151
```
152152

153-
You can decide whether a section should be mandatory or not. Making a section mandatory means that any templates using the Master Template is required to have the section defined.
153+
You can decide whether a section should be mandatory or not. Making a section mandatory means that any template using the Master Template is required to have the section defined.
154154

155155
To make the section mandatory, you have two options:
156156

157157
* Check the **Section is mandatory** field when using the **Sections** dialog in the backoffice.
158-
* Add `true` to the code tag like shown in the example below.
158+
* Add `true` to the code tag as shown in the example below.
159159

160160
```csharp
161161
@RenderSection("Head", true)
@@ -167,7 +167,7 @@ To make the section mandatory, you have two options:
167167

168168
Another way to reuse HTML is to use partial views - which are small reusable views that can be injected into another view.
169169

170-
Like templates, create a partial view, by clicking **...** next to the **Partial Views** folder and selecting **Create**. You can then either create an empty partial view or create a partial view from a snippet.
170+
Like templates, you can create a partial view, by clicking **...** next to the **Partial Views** folder and selecting **Create**. You can then either create an empty partial view or a partial view from a snippet.
171171

172172
![Create partial](images/create-partial.png)
173173

0 commit comments

Comments
 (0)