USING SPECIAL UMBRACO TAGS

Like most CMSs, Umbraco utilizes special tags to render any content that is entered by a user in the backoffice. If you're at all familiar with .NET syntax for including user controls or custom tags, this should make you feel right at home. Here's what a basic tag looks like:

<umbraco:Item field=“pageName” runat=“server”></umbraco:Item>

This is the tag in its simplest form. It can get more complex than this—in fact, a lot more complex. The Umbraco backoffice UI has a widget to insert these Umbraco items in your templates, so you don't have to do the heavy lifting. This includes built-in fields, like the one field reference in the previous code snippet, as well as custom document type properties. You can launch the Insert Umbraco page field dialog (shown in Figure 4-9) by clicking the insert Umbraco page field button located toward the top of the right-hand pane next to the Save button.

FIGURE 4-9

image

The Insert Umbraco page field dialog contains the fields presented in Table 4-1.

TABLE 4-1: Umbraco Page Fields

FIELD DESCRIPTION
Choose field Allows you to pick from any of the built-in properties provided by Umbraco or any of the custom properties that you defined in your document types.
Alternative field Offers the same list of properties as available in the Choose Field, only the Alternative Field option is used if the Choose Field value is null ...

Get Umbraco User's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.