Template: Semorg-generator: Difference between revisions

From SemanticOrganization
Jump to: navigation, search
No edit summary
No edit summary
 
(121 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>{{semorg-bundle}}</noinclude><includeonly>[[Category:{{int:Semorg-generator-category}}]]{{#semorg-set:generator
This is the "Generator" template.
</noinclude><includeonly>{{#set:
   |template-name={{lc:{{FULLPAGENAME}}}}
   |template-name={{lc:{{FULLPAGENAME}}}}
   |template-id={{{template-id|}}}
   |template-id={{{template-id|}}}
  |form-page-name={{{form-page-name|}}}
}}
}}[[Category:Generator]]
{{{template-fields|}}}
{{{template-fields|}}}
=== Property Registration ===
{{#ask:[[field-template::{{FULLPAGENAME}}]]
  |?field-id=field-id
  |?field-property-id=field-property-id
  |?field-type=field-type
  |?field-template.template-id=template-id
  |?field-template.template-name=template-name
  |format=template
  |link=none
  |named args=yes
  |template=Generator-property-registration
}}


=== Messages ===
=== Messages ===


{{#if:{{{form-add-button-text|}}}
  |
"semorg-{{lc:{{FULLPAGENAME}}}}-template": "semorg-{{lc:{{FULLPAGENAME}}}}",
"semorg-form-{{lc:{{FULLPAGENAME}}}}-add-button-text": "{{{form-add-button-text}}}",
  |
  "semorg-{{lc:{{FULLPAGENAME}}}}-template": "semorg-{{lc:{{FULLPAGENAME}}}}",
  "semorg-{{lc:{{FULLPAGENAME}}}}-template": "semorg-{{lc:{{FULLPAGENAME}}}}",
  "semorg-{{lc:{{FULLPAGENAME}}}}-category": "semorg-{{lc:{{FULLPAGENAME}}}}",
  "semorg-{{lc:{{FULLPAGENAME}}}}-category": "semorg-{{lc:{{FULLPAGENAME}}}}",
  "semorg-{{lc:{{FULLPAGENAME}}}}-form": "semorg-{{lc:{{FULLPAGENAME}}}}",
  "semorg-{{lc:{{FULLPAGENAME}}}}-form": "semorg-{{lc:{{FULLPAGENAME}}}}"{{#if:{{{page-name|}}}|,
  "semorg-form-{{lc:{{FULLPAGENAME}}}}-create-title": "{{FULLPAGENAME}} erstellen",
"semorg-{{lc:{{FULLPAGENAME}}}}-page-name": "{{{page-name|}}}"}}{{#if:{{{entity-name|}}}|,
  "semorg-form-{{lc:{{FULLPAGENAME}}}}-edit-title": "{{FULLPAGENAME}} bearbeiten",
"semorg-{{lc:{{FULLPAGENAME}}}}-entity-name": "{{{entity-name|}}}"}},
  "semorg-form-{{lc:{{FULLPAGENAME}}}}-create-title": "Create {{{form-titles|{{{entity-name|{{FULLPAGENAME}}}}}}}}",
  "semorg-form-{{lc:{{FULLPAGENAME}}}}-edit-title": "Edit {{{form-titles|{{{entity-name|{{FULLPAGENAME}}}}}}}}",  
  {{#if:{{{form-page-name|}}}
  {{#if:{{{form-page-name|}}}
   |"semorg-form-{{lc:{{FULLPAGENAME}}}}-page-name": "{{{form-page-name}}}",
   |{{#ifeq:{{{form-unique-number|}}}|Yes
  "semorg-formlink-{{lc:{{FULLPAGENAME}}}}-link-text": "{{FULLPAGENAME}} erstellen",
    |"semorg-form-{{lc:{{FULLPAGENAME}}}}-page-name": "{{{form-page-name}}}",
   |"semorg-forminput-{{lc:{{FULLPAGENAME}}}}-button-text": "{{FULLPAGENAME}} erstellen",
  }}
}}
}}
  {{#if:{{{placeholder|}}}
   |"semorg-forminput-{{lc:{{FULLPAGENAME}}}}-placeholder": "{{{placeholder}}}",
}}
}}
  "semorg-form-{{lc:{{FULLPAGENAME}}}}-rows": "{{#ask:[[field-template::{{FULLPAGENAME}}]]
"semorg-form-{{lc:{{FULLPAGENAME}}}}-template": "{{{form-template|{{lc:{{FULLPAGENAME}}}}}}}"{{#if:{{{rows|}}}
  |,
"semorg-form-{{lc:{{FULLPAGENAME}}}}-rows": "{{{rows}}}"
  |,
  "semorg-form-{{lc:{{FULLPAGENAME}}}}-rows": "{{#ask:[[semorg-generator-field-template::{{FULLPAGENAME}}]]
   |mainlabel=-
   |mainlabel=-
   |?field-id=
   |?Semorg-generator-field-id=
   |format=list
   |format=list
}}",{{#ask:[[field-template::{{FULLPAGENAME}}]]
  |limit=1000
   |?field-id=field-id
}}"
   |?field-property-id=field-property-id
}}{{#if:{{{list-headers|}}}
   |?field-name=field-name
  |,
   |?field-fields=field-fields
"semorg-list-{{lc:{{FULLPAGENAME}}}}-headers": "{{{list-headers}}}"
   |?field-parameters=field-parameters
  |,
   |?field-prefix=field-prefix
"semorg-list-{{lc:{{FULLPAGENAME}}}}-headers": "{{#arraymap:{{#ask:[[semorg-generator-field-template::{{FULLPAGENAME}}]]
   |?field-suffix=field-suffix
  |mainlabel=-
   |?field-template.template-id=template-id
  |?Semorg-generator-field-id=
   |?field-template.template-name=template-name
  |format=list
  |limit=1000
}}|,|xxx|{{lc:{{FULLPAGENAME}}}}-xxx}}"
}},{{#ask:[[semorg-generator-field-template::{{FULLPAGENAME}}]]
   |?Semorg-generator-field-id=field-id
   |?Semorg-generator-field-property-id=field-property-id
   |?Semorg-generator-field-name=field-name
   |?Semorg-generator-field-fields=field-fields
   |?Semorg-generator-field-parameters=field-parameters
   |?Semorg-generator-field-prefix=field-prefix
   |?Semorg-generator-field-suffix=field-suffix
   |?Semorg-generator-field-help=field-help
  |?Semorg-generator-field-input-type=field-input-type
  |?Semorg-generator-field-label=field-label
  |?Semorg-generator-field-values=field-values
  |?Semorg-generator-field-size=field-size
  |?Semorg-generator-field-placeholder=field-placeholder
  |?Semorg-generator-field-intro=field-intro
  |?Semorg-generator-field-rights=field-rights
  |?Semorg-generator-field-template.Semorg-generator-template-id=template-id
   |?Semorg-generator-field-template.Semorg-generator-template-name=template-name
  |sort=Semorg-generator-field-id
   |format=template
   |format=template
   |link=none
   |link=none
   |named args=yes
   |named args=yes
   |template=Generator-messages
   |template=Semorg-generator-messages
  |limit=1000
}}{{#if:{{{display-title-message|}}}
  |,
"semorg-{{lc:{{FULLPAGENAME}}}}-displaytitle": "{{{display-title-message}}}"
}}
}}


=== Category ===
=== Form ===
 
[[Form:Semorg-{{lc:{{FULLPAGENAME}}}}]]
 
<nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly>{{{info
  |create title={{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-create-title}}
  |edit title={{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-edit-title}}<span class="d-none">: <page name></span>
  |page name=</nowiki>{{#ifeq:{{{form-unique-number|}}}|Yes
    |<nowiki>{{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-page-name}}/<unique number;start=1></nowiki>
    |{{{form-page-name|}}}
  }}<nowiki>
}}}
 
{{semorg-form-template|</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>}}
{{semorg-form-standard-inputs}}
</nowiki></include<nowiki></nowiki>only>
 
'''as embedded:'''


<code>Category:Semorg-{{lc:{{FULLPAGENAME}}}}</code>
Use this code, if this is not meant to be a standalone feature but rather a supplement that should be embedded in other forms. Add this line to a form definition that includes a field with the parameter <code>holds template</code>. The second parameter of the <code>semorg-form-template-embed</code> call should be the target field, specified with <code>''<feature>''[''<field>'']</code> (e.g. <code>meeting-group[files]</code> or <code><nowiki>{{int:semorg-meeting-group-template}}[files]</nowiki></code> to respect template customization).


  <nowiki><noinclude>{{semorg-bundle}}</noinclude>{{#default_form:{{int:Semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-form}}}}</nowiki>
  <nowiki>{{semorg-form-template-embed|</nowiki>{{lc:{{FULLPAGENAME}}}}|{{{embed-field|}}}<nowiki>}}</nowiki>


=== Form ===
=== Category ===


<code>Form:Semorg-{{lc:{{FULLPAGENAME}}}}</code>
[[:Category:Semorg-{{lc:{{FULLPAGENAME}}}}]]


  <nowiki><noinclude>{{semorg-bundle}}</nowiki>
  <nowiki>{{semorg-category}}</nowiki>
<nowiki>{{#formlink:form={{PAGENAME}}<nowiki>|link text={{int:semorg-formlink-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-link-text}}}}</nowiki>
<nowiki></noinclude><includeonly>{{{info
  |create title={{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-create-title}}
  |edit title={{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-edit-title}}
  |page name={{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-page-name}}/<unique number;start=1>
}}}
{{{for template
  |semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>
}}}
<table class="formtable">
{{#semorg-field-rows:{{int:semorg-form-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-rows}}
  |template=</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>
}}
</table>
{{{end template}}}
{{semorg-form-standard-inputs}}
</nowiki></include<nowiki></nowiki>only>


=== Template ===
=== Template ===


<code>Template:Semorg-{{lc:{{FULLPAGENAME}}}}</code>
[[Template:Semorg-{{lc:{{FULLPAGENAME}}}}]]


  <nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly>[[Category:semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>]]{{#semorg-set:</nowiki>{{lc:{{FULLPAGENAME}}}}{{#ask:[[field-template::{{FULLPAGENAME}}]]
  <nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly>[[Category:{{int:semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-category}}]]{{#semorg-set:</nowiki>{{lc:{{FULLPAGENAME}}}}{{#ask:[[Semorg-generator-field-template::{{FULLPAGENAME}}]]
   |mainlabel=-
   |mainlabel=-
   |?field-id
   |?semorg-generator-field-id
   |template=Generator-setter
   |template=Semorg-generator-setter
   |format=template
   |format=template
  |limit=1000
}}
}}
  <nowiki>}}</nowiki>
  <nowiki>}}{{#semorg-detail:</nowiki>{{lc:{{FULLPAGENAME}}}}{{#if:{{{display-title|}}}|<nowiki>
  |</nowiki>heading={{{display-title}}}<nowiki>
<nowiki>{{#semorg-table:</nowiki>{{lc:{{FULLPAGENAME}}}}{{#ask:[[field-template::{{FULLPAGENAME}}]]
</nowiki>}}<nowiki>}}{{#semorg-table:</nowiki>{{lc:{{FULLPAGENAME}}}}{{#ask:[[Semorg-generator-field-template::{{FULLPAGENAME}}]]
   |mainlabel=-
   |mainlabel=-
   |?field-id
   |?semorg-generator-field-id
   |template=Generator-setter
   |template=Semorg-generator-setter
   |format=template
   |format=template
  |limit=1000
}}
}}
<nowiki>}}</nowiki>
</include<nowiki></nowiki>only>
=== List Template ===
<code>Template:Semorg-{{lc:{{FULLPAGENAME}}}}-list</code>
<nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly>{{#ask:[[Category:semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>]]</nowiki>
  |mainlabel={{lc:{{FULLPAGENAME}}}}{{#ask:[[field-template::{{FULLPAGENAME}}]]
    |?field-template=field-template
    |?field-id=field-id
    |template=Generator-list-field
    |named args=yes
    |format=template
    |link=none
  }}
  |link=none
  |named args=yes
  |format=template
  |template=semorg-{{lc:{{FULLPAGENAME}}}}-row
  |intro=<nowiki>{{semorg-list-intro</nowiki>|columns={{#ask:[[field-template::{{FULLPAGENAME}}]]
  |mainlabel=-
  |?field-id=field-id
  |?field-template.template-name=template-name
  |named args=true
  |link=none
  |template=Generator-list-columns
  |format=list
}}<nowiki>}}</nowiki>
  |outro=<nowiki>{{semorg-list-outro}}</nowiki>
  <nowiki>}}</nowiki></include<nowiki></nowiki>only>
  <nowiki>}}</nowiki></include<nowiki></nowiki>only>


=== Row Template ===
=== Row Template ===


<code>Template:Semorg-{{lc:{{FULLPAGENAME}}}}-row</code>
[[Template:Semorg-{{lc:{{FULLPAGENAME}}}}-row]]


  <nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly><tr></nowiki>
  <nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly><tr></nowiki>
  <nowiki><td>{{{?</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>|}}}</td></nowiki>{{#ask:[[field-template::{{FULLPAGENAME}}]]
  <nowiki><td>[[{{{target|}}}]]</td></nowiki>{{#ask:[[Semorg-generator-field-template::{{FULLPAGENAME}}]]
     |?field-template=field-template
     |?Semorg-generator-field-template=field-template
     |?field-id=field-id
     |?Semorg-generator-field-id=field-id
     |template=Generator-row-field
     |template=Semorg-generator-row-field
     |named args=yes
     |named args=yes
     |format=template
     |format=template
     |link=none
     |link=none
    |limit=1000
   }}
   }}
  <nowiki>{{semorg-showedit</nowiki>
  <nowiki>{{semorg-showedit</nowiki>
   |target=<nowiki>{{{?</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>|}}}</nowiki>
   |target=<nowiki>{{{target|}}}</nowiki>
  <nowiki>}}</nowiki>
  <nowiki>}}</nowiki>
  <nowiki></tr></nowiki></include<nowiki></nowiki>only>
  <nowiki></tr></nowiki></include<nowiki></nowiki>only>
=== Overview Page Template ===
[[Template:Semorg-{{lc:{{FULLPAGENAME}}}}-overview]]
<nowiki><noinclude>{{semorg-bundle}}</noinclude><includeonly></nowiki>{{#if:{{{custom-overview-list|}}}
|{{{custom-overview-list}}}
|<nowiki>{{</nowiki>#semorg-list:{{lc:{{FULLPAGENAME}}}}<nowiki>
  |heading={{int:semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-page-name}}
  |</nowiki>formlink={{#if:{{{form-page-name|}}}
  |<nowiki>{{#semorg-formlink:</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>}}</nowiki>
  |<nowiki>{{#semorg-forminput:</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>}}</nowiki>
  }}
<nowiki>  |links={{{links|}}}
  |query={{{query|}}}
  |sort={{{sort|}}}
  |order={{{order|}}}
  |limit={{{limit|}}}
  |filter links={{{filter links|}}}
  |filters={{{filters|}}}
  |category={{{category|}}}
  |headers={{{headers|}}}
  |row template={{{row template|}}}
  |tableclass={{{tableclass|}}}
  |title={{{title|}}}
  |sums={{{sums|}}}
  |csv={{{csv|}}}
  |default={{{default|}}}
  |returnto={{{returnto|}}}
  |help={{{help|}}}
}}</nowiki>
}}</include<nowiki></nowiki>only>


=== Overview Page ===
=== Overview Page ===


<code>{{FULLPAGENAME}}s</code>
[[{{{page-name|}}}]]
 
<nowiki>{{</nowiki>semorg-{{lc:{{FULLPAGENAME}}}}-overview<nowiki>}}</nowiki>
 
=== Property Registration ===
 
Add the following line to <code>LocalSettings.php</code>:


  {{#if:{{{form-page-name|}}}
  $wgSemorgAdditionalProperties['{{lc:{{FULLPAGENAME}}}}'] = <nowiki>[</nowiki> "id" => "{{{template-id|}}}","fields" => <nowiki>[</nowiki>{{#ask:[[Semorg-generator-field-template::{{lc:{{FULLPAGENAME}}}}]][[Semorg-generator-field-property-id::+]]
  |<nowiki>{{#formlink:form=Semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>|link text={{int:semorg-formlink-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-link-text}}}}</nowiki>
      |mainlabel=field
  |<nowiki>{{#forminput:form=Semorg-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>|button text={{int:semorg-forminput-</nowiki>{{lc:{{FULLPAGENAME}}}}<nowiki>-button-text|no autofocus<nowiki>}}</nowiki>
      |?Semorg-generator-field-id=field-id
}}
      |?Semorg-generator-field-property-id=field-property-id
      |?Semorg-generator-field-type=field-type
<nowiki>{{</nowiki>Semorg-{{lc:{{FULLPAGENAME}}}}-list<nowiki>}}</nowiki>
      |named args=yes
      |template=semorg-generator-register-property-field
      |format=template
      |limit=1000
      }} <nowiki>]</nowiki> <nowiki>]</nowiki>;


</includeonly>
</includeonly>

Latest revision as of 15:34, 14 March 2023

This page is part of the Semantic Organization extension.

If you want to customize this template you can copy its contents to another page (use for example Template:Semorg-generator-custom) and change the following system message to the name of the newly created page: MediaWiki:semorg-generator-template