Extension:Page Forms/Quick start guide/zh

目前，您已经设置好了您的站点的所有软件. 之后呢？现在是时候创建用于保存、显示以及启用添加和编辑数据的结构了. 值得庆幸的是，所有这些都可以通过创建各种Wiki页面来完成.

第一步，明晰您的数据结构. 您的网站有哪些类型的页面？ 每个页面需要包含哪些数据？ 您可以稍后再更改所有这些，但是您应该有一个开始计划. 一旦明晰了这些（最好是写下来），就可以开始创建必要的Wiki页面. 您将需要为模板和表单（可能还有分类）以及（如果使用语义MediaWiki）属性创建或修改页面.

您可以从头开始创建所有这些文件，尽管也存在帮助程序表单来帮助创建它们. 正确的方法取决于您使用的其他扩展：

简单方法 - 特殊:创建类
页面Special:CreateClass（由页面表单定义）提供了一个助手表单，可以在一个页面内定义有关数据“类”的所有内容. 如果填写这些字段并单击“提交”，页面将自动创建必要的模板、表单和分类页面. 然后，您可以转到已创建的表单页面，并开始输入数据.

如果有些页面还未创建，则可能是您的作业队列缺少足够的内存. 有关如何添加更多内存的信息，请参见作业队列相关的项目.

更全面的方法
您应该采取以下步骤： Just go to the form page(s), and start creating pages.
 * 创建模板. 模板决定了页面上数据的显示方式，包含了将数据存储在Cargo表中的标记，并且（通常）将页面定义为特定分类，从而具有特定页面类型. 每个页面类型通常会有一个模板，尽管有时一个页面类型会包含多个模板.  模板也可以用于汇总，显示与此页面有一定关系的所有其他页面的列表.  可以在Special:CreateTemplate页面创建模板.
 * 创建表单. 现在您可以创建表单，以便用户增加和编辑各类型的页面. 每种页面类型应有一个表单；表单将填充此页面类型包含的一个或多个模板.  与之前相同，特殊页面Special:CreateForm用于创建新的表单.
 * 创建分类. 每个表单中的一个模板应标记该表单创建的每一条文章，使其属于某个分类. 您应该为每个此种分类创建一个页面，并为其指定一个默认表单，以便可以使用与创建该表单相同的表单自动编辑每篇文章.  最简单的方法是使用Special:CreateCategory页面.
 * 添加到表单的链接. 除了创建具有默认表单的类别之外，还应该执行其他步骤以使用户能够访问您创建的表单. 其中包括在侧栏或其他位置添加链接以便添加数据，并使用#formredlink来使指向不存在页面的红色链接指向用于创建它们的表单.  这些操作都在“链接到表单”页面中进行了说明.
 * 在侧栏或其他位置添加链接. 您可以编辑侧栏（可以在“MediaWiki:Sidebar”页面上对其进行编辑）以容纳添加每种数据类型的链接. You could also add a link to the page Special:Drilldown, a Cargo-defined page that provides an easy way to view all the wiki's data at a glance. You can also include such links on the main page and elsewhere.
 * Add data. Now you can start entering data!
 * Customize. Once the structure is in place, you can customize all you want - changing the look-and-feel of the entire wiki, of the various templates, and of the forms, adding and changing fields and adding and changing queries.

The easy way - Special:CreateClass
The page Special:CreateClass, defined by Page Forms, provides a single helper form to define everything about a data "class" in one place. If you fill out the fields and hit "submit", the page will create all the necessary property, template, form and category pages automatically. Then you can go to the form page that was created, and start entering data.

If not all the pages seem to be getting created, it could be that your job queue lacks enough memory. See the job-queue-related item here for how to add more memory.

The more comprehensive way
You should take the following steps:

A property is used to specify a single piece of information about the topic of this page. Every property should be defined on your wiki, with a page in the "Property:" namespace. Create each property by going to the Special:CreateProperty page. There will generally be one template per page type, although sometimes a single page type will contain more than one template. A template can also be used for aggregation, by displaying a list of all other pages that have a certain relationship to this page (see the inline queries documentation for much more information on this). Create the template(s) by going to the Special:CreateTemplate page. There should be one form per page type; the form will populate the template or templates that this page type contains. As before, there's a special page to create new forms: Special:CreateForm. You should create a page for each such category, and specify a default form for it so that every article is automatically editable with the same form that created it. The easiest way to do that is by using the Special:CreateCategory page. These include adding links to add data in the sidebar and elsewhere, and using #formredlink in order to have red-links to nonexistent pages point to a form for creating them. These actions are all explained in the section "Linking to forms". You can also include such links on the main page and elsewhere. Just go to the form page(s), and start creating pages.
 * Create properties. The basic building blocks of any semantic site are the connections between data, which in Semantic MediaWiki are known as properties.
 * Create templates. A template sets the display of the data on a page, holds the markup to turn the data into actual semantic information, and (often) defines the page as being of a certain category, and thus of a certain page type.
 * Create forms. Now you can create forms to allow users to easily add and edit pages of various types.
 * Create categories. One template in each form should tag each article that the form creates as being part of a certain category.
 * Enable links to forms. Besides creating categories that have a default form, there are other steps you should take to enable users to access the forms that you have created.
 * Add links on sidebar and elsewhere. The sidebar (which, for English-language wikis, can be edited at the page "MediaWiki:Sidebar") should hold links to add each of the data types, and to the categories for each of these data types as well.
 * Add data. Now you can start entering data!
 * Customize. Once the structure is in place, you can customize all you want - changing the look-and-feel of the entire wiki, of the various templates, and of the forms, adding and changing fields and adding and changing inline queries.

例子
Let's go through a specific example of setting up a Page Forms-based wiki from scratch, in the "more comprehensive way". Let's say that you want to create a wiki that shows all the books you have at home. We'll then go through the previous steps specified, with some parts different for Cargo vs. SMW.

1. Figure out the data structure. You want two kinds of pages on your wiki: one for books, and one for authors. Each book page should hold a title, an author name (or names), a genre (or genres), a year of publication, and a number of pages. Each author page should hold the author name, their country of origin, and a list of all the books they have written that you own.

2. Create properties.

3. Create templates. You need to create two templates, one for books and one for authors, both at the "Create a template" page at.

First, books:

Next, create the template for Authors - using the "Create a template" page, you create a template called "Author", and set it to define the category "Authors".

4. Create forms. You need to create two forms, one for books and one for authors:


 * Books - using the "Create a form" page (at ), you make a form called "Book", select the template "Book" and click the Add button. You could also optionally add a section for the plot of the book - to do that, add a section (not a template) called "Plot". You do not do any further customizations on this form, but just save the form once you have created it.
 * Authors - using the "Create a form" page, you make a form called "Author", and add to it the template "Author". As before, you do not do any further customizations - you just save the page.

5. Create categories. You need to create two categories, one for books and one for authors; you have already specified these categories' names before:


 * Books - using the "Create a category" page (at ), you make a category called "Books", and give it the default form "Book".
 * Authors - using the "Create a category" page, you make a category called "Authors", and give it the default form "Author".

6. Enable links to forms.

This will make links to author pages that don't exist yet point to the form for creating those pages.

7. Add data. Using the new "Book" form (at ), you create pages for some books; you check to make sure that both the form and the resulting pages look alright. Each book page will now have a red link to its author, that should point to the "Author" form for adding that author (you may need to refresh the page for the right link to show up). You can then add a few authors, either through these links or from the form page directly, to make sure that this setup works correctly too. Each created author's page should show a list of the books you've saved that have that person as the author.

8. Add links on sidebar and elsewhere. Your structures are now all set up, and you can add links to the sidebar for easy adding and viewing, by modifying the page  (or its equivalent if you're using a language other than English). You can add links to the "Book" and "Author" forms to make it easy to add new ones. You could also link to Special:Drilldown (if you have Cargo installed), or Special:BrowseData (if you have the Semantic Drilldown extension installed), to let users view all the data at a glance.

页面使用模型
The Page Schemas extension is specifically intended for the automated creation of data structures, including forms. Its big advantage over the standard PF helper forms is that it can be used to create and modify these data structure pages many times, not just create them one time. It can be used with either Cargo or Semantic MediaWiki installed, or with neither one installed. If Cargo and/or SMW are installed, the Page Schemas form will include many additional form fields in order to create the additional tags needed. To create a page schema, you need to go to the category page (whether or not it has been created yet), go to the tab action for creating that page's schema, fill out the form, then go the tab action for generating pages based on that schema. 请参阅Page Schemas来获取更多信息.

快速参考指南
There are two quick reference guides, or "cheat sheets", suitable for printing, that contain helpful information about Page Forms (though in both cases they still refer to it as "Semantic Forms"), among other extensions:
 * The Cargo quick reference guide - in PNG and PDF formats
 * The Semantic MediaWiki quick reference guide - can be found here, in PNG (image), PDF and SVG formats