Skip to content

使用Designer Helper工具自定义Orchard-Customizing Orchard Using Designer Helper Tools

Orchard provides a designer tool named Shape Tracing that enables you to customize the appearance of your site. The Shape Tracing module provides tools that you can use to select sections of your website and discover information about the rendering code.

Orchard提供名为 Shape Tracing 的设计器工具,可让您自定义站点的外观。 Shape Tracing 模块提供了一些工具,您可以使用这些工具选择网站的各个部分并发现有关渲染代码的信息。

Getting Started with Shape Tracing

形状跟踪入门

To use Shape Tracing, first enable the Shape Tracing feature in the dashboard. The Shape Tracing feature comes with the Designer Tools module, that you may have to install. After you enable the feature, you will notice a narrow frame across the bottom of the web page when you navigate to your site, similar to the following illustration:

要使用形状跟踪,首先在仪表板中启用形状跟踪功能。 Shape Tracing 功能随[Designer Tools](http://gallery.orchardproject.net/List/Modules/Orchard.Module.Orchard.DesignerTools)模块一起提供,您可能需要安装该模块。启用该功能后,当您导航到您的站点时,您会注意到网页底部有一个窄框,类似于下图:

When the Shape Tracing frame is collapsed, your site functions as it would normally. However, when you click the icon, the frame expands and displays Shape Tracing features.

形状跟踪框架折叠时,您的网站将正常运行。但是,单击该图标时,框架将展开并显示形状跟踪功能。

Shape Information

形状信息

When the Shape Tracing frame is expanded, you can hold the mouse pointer over a section of a page and that section is highlighted. Click the highlighted section to display information about the shape and how it is rendered.

Shape Tracing 框架展开时,您可以将鼠标指针悬停在页面的某个部分上,并突出显示该部分。单击突出显示的部分以显示有关形状及其呈现方式的信息。

The left side of the frame displays which shape is selected. It also enables you to select which shape to highlight by providing a navigable tree for the shapes.

框架的左侧显示选择的形状。它还允许您通过为形状提供可导航树来选择要突出显示的形状。

The right side displays information about the selected shape and enables you to select which type of information to display.

右侧显示有关所选形状的信息,并允许您选择要显示的信息类型。

The Shape Tracing pane displays the following information:

Shape Tracing 窗格显示以下信息:

  • Shape. Information about the shape and the template to render the shape. Includes the option of creating alternates as described later in this article.

  • 形状。有关形状和模板的信息以呈现形状。包括创建替代项的选项,如本文后面所述。

  • Model. Information about the model for this shape.

  • 模型。有关此形状的模型的信息。

  • Placement. The Placement.info file.

  • 放置Placement.info文件。

  • Template. The code in the template file

  • 模板。模板文件中的代码

  • HTML. The HTML for rendering this shape.

  • HTML。用于呈现此形状的HTML。

Creating Alternate Templates

创建备用模板

The Shape Tracing interface displays links that let you automatically create alternate templates for a shape. The interface displays the available alternate templates and includes a link titled Create to generate that template.

Shape Tracing 界面显示的链接可让您自动为形状创建备用模板。界面显示可用的备用模板,并包含标题为 Create 的链接以生成该模板。

The Create option only creates the template in the specified directory. You must customize the template to render the shape as needed. If you are using Visual Studio, you must include the template in your project by selecting Add > Existing Item in Solution Explorer.

Create 选项仅在指定目录中创建模板。您必须自定义模板以根据需要呈现形状。如果您使用的是Visual Studio,则必须通过选择 Add >在项目中包含该模板。 解决方案资源管理器中的现有项目

For more information about how to create alternates, see Alternates.

有关如何创建替代项的更多信息,请参阅[替代](替代)。