语义形式 - 带有信息标签和页面名称参数的问题

时间:2013-05-27 22:41:00

标签: forms mediawiki semantics

试图弄清楚如何使用表单中的值自动创建页面名称 一直在阅读这个页面: http://www.mediawiki.org/wiki/Extension:Semantic_Forms/Linking_to_forms#The_one-step_process

在阅读之后,我无法弄清楚如何去做,但我认为这是可能的,如果有人知道如何使用它的所有帮助将受到欢迎

嗯,这就是我所拥有的

<noinclude>
This is the "OARK" form.
To create a page with this form, enter the page name below;
if a page with that name already exists, you will be sent to a form to edit that page.

{{{info page name=<Organizational artifact relation kind[Prefix_1_2]>.
<Organizational artifact relation kind[Is target of reference law 1]>.
<Organizational artifact relation kind[Infix_2_1]>.<Organizational artifact relation kind[Is target of reference law 2]>.
<Organizational artifact relation kind[Sufix_2_1]>}}}

</noinclude><includeonly>
<div id="wikiPreview" style="display: none; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid #AAAAAA;"></div>
{{{for template|Organizational artifact relation kind}}}
{| class="formtable"
! Prefix_1_2:
| {{{field|Prefix_1_2}}}
|-
! Unicity 1:
| {{{field|Unicity 1}}}
|-
! Dependency 1:
| {{{field|Dependency 1}}}
|-
! Infix_1_2:
| {{{field|Infix_1_2}}}
|-
! Sufix_1_2:
| {{{field|Sufix_1_2}}}
|-
! Prefix_2_1:
| {{{field|Prefix_2_1}}}
|-
! Unicity 2:
| {{{field|Unicity 2}}}
|-
! Dependency 2:
| {{{field|Dependency 2}}}
|-
! Infix_2_1:
| {{{field|Infix_2_1}}}
|-
! Sufix_2_1:
| {{{field|Sufix_2_1}}}
|-
! Is target of reference law 1:
| {{{field|Is target of reference law 1}}}
|-
! Is target of reference law 2:
| {{{field|Is target of reference law 2}}}
|}
{{{end template}}}

'''Free text:'''

{{{standard input|free text|rows=10}}}

{{{standard input|summary}}}

{{{standard input|minor edit}}} {{{standard input|watch}}}

{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}}
</includeonly>

像往常一样它不会工作,因为我无法弄清楚如何在代码中编写它,但一般的想法是在特定字段中获取模板的值,然后创建一个具有该名称的页面,该页面具有所有我之前填的价值。

1 个答案:

答案 0 :(得分:1)

我认为您唯一的问题是info标记的格式和位置。你应该有类似的东西:

{{{info|add title=Add a match|edit title=Edit a match|page name=Game:<Match[Event]> <Match[Bracket]> <Match[Team A]> v. <Match[Team B]> <unique number>}}}

使用你的例子:

{{{info|page name=<Organizational artifact relation kind[Prefix_1_2]>.
<Organizational artifact relation kind[Is target of reference law 1]>.
<Organizational artifact relation kind[Infix_2_1]>.
<Organizational artifact relation kind[Is target of reference law 2]>.
<Organizational artifact relation kind[Sufix_2_1]>}}}

并且您需要确保它包含在所包含的表单中,您目前在noinclude部分中已将其包含在内。