Using Page Template Features

Make use of Page Template Features in Razor templates

In C1 CMS v.4.0 or later, you can add content to multiple Page Template Features in the Layout perspective and then include those features in templates.

To include a page template feature in a Razor template, use the @PageTemplateFeature helper method specifying the name of the feature to include.

For example, if you have a page template feature called "Aside Column", this is how you can include it in your template:

@inherits RazorPageTemplate

@functions {
	public override void Configure()
	{
		TemplateId = new Guid("b270f819-0b5c-4f7e-9194-4b554043e4ab");
		TemplateTitle = "Another Razor Template";
    }

	[Placeholder(Id = "content", Title="Content", IsDefault = true)]
    public XhtmlDocument Content { get; set; }
}
<html xmlns="http://www.w3.org/1999/xhtml">
	<head></head>
	<body>
		<div class="row">
			<div class="span8">
				@Html.Raw(Content)
			</div>
			<div class="span4">
				@PageTemplateFeature("Aside Column")
			</div>
		</div>
	</body>
</html>

Download the sample