简体   繁体   English

在Umbraco CMS中创建和使用模板

[英]Create and Use Template in Umbraco CMS

I am new to Umbraco. 我是Umbraco的新手。

I have to create a template in umbraco cms and need to use that, I have created templates in the templates directory found in umbraco admin panel. 我必须在umbraco cms中创建一个模板,并且需要使用它,我已经在umbraco管理面板中的模板目录中创建了模板。 now I need to set it template for any page I have created. 现在,我需要为我创建的任何页面设置模板。 how I do this ? 我该怎么做?

any help will be appreciated. 任何帮助将不胜感激。

The template only defines how the page is structured. 该模板仅定义页面的结构。 What you need to do is create a document type which defines a set of data. 您需要做的是创建一个定义一组数据的文档类型。

Go to document types, create new, and make sure to add your newly created template as one of the allowed templates for this document type. 转到文档类型,创建新的文档,并确保将新创建的模板添加为该文档类型允许的模板之一。

Then go to Content, and create a new document of the above document type - selecting the template you created, as template. 然后转到“内容”,并创建具有上述文档类型的新文档-选择创建的模板作为模板。 (You may need to add your newly created document type to the list of allowed types (structure tab) under the document type of your root node). (您可能需要将新创建的文档类型添加到根节点文档类型下的允许类型列表(结构选项卡))。

Make sure to publish when you're done 完成后请确保发布

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM