Personal tools

Template:ReferenceData: Difference between revisions

From GxPlex

Jump to: navigation, search
Add Template:ReferenceData for PageForms
 
Deploy ANG-2026-0011
 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
shown in the table — the import script resolves this automatically; when editing by hand,
shown in the table — the import script resolves this automatically; when editing by hand,
update both together.
update both together.
<code>RefPreview</code> is derived automatically from <code>content</code> (first 150 characters)
and is only used for the preview column in [[Template:DocumentData|DocumentData]]'s References
query — no separate field to fill in.
'''Original entry by''' and '''Contributors''': if the field is empty, the values come from the
page history of the Reference, like on Document pages (see [[Template:DocumentData]]). Accounts
listed in [[MediaWiki:Gplx-excluded-contributors]] are left out.
<code>has_document</code> accepts the Document name with or without the <code>Document:</code> prefix.
The form stores it without the prefix, imported pages carry it. The template adds the prefix when it is missing.


== Usage ==
== Usage ==
Line 32: Line 43:
[[Category:Templates]]
[[Category:Templates]]
</noinclude><includeonly>{{#set:
</noinclude><includeonly>{{#set:
|HasDocument={{{has_document|}}}
|HasDocument={{#if:{{{has_document|}}}|{{#ifeq:{{NAMESPACENUMBER:{{{has_document}}}}}|3000||Document:}}{{{has_document}}}}}
|RefScope={{{scope|}}}
|RefScope={{{scope|}}}
|RefDocPart={{{doc_part|}}}
|RefDocPart={{{doc_part|}}}
Line 39: Line 50:
|RefModule={{{module|}}}
|RefModule={{{module|}}}
|RefUnit={{{unit|}}}
|RefUnit={{{unit|}}}
|RefPreview={{#sub:{{{content|}}}|0|150}}{{#if:{{#expr:{{#len:{{{content|}}}}}>150}}| …|}}
}}
}}


{{:{{{has_document|}}}}}
{{#if:{{{has_document|}}}|{{#gplxrefdoc:{{#ifeq:{{NAMESPACENUMBER:{{{has_document}}}}}|3000||Document:}}{{{has_document}}}}}{{:{{#ifeq:{{NAMESPACENUMBER:{{{has_document}}}}}|3000||Document:}}{{{has_document}}}}}}}


{| class="wikitable gplx-infobox"
{| class="wikitable gplx-infobox"
|-
|-
! colspan="2" class="gplx-infobox-header" | Reference Details
! colspan="2" scope="col" class="gplx-infobox-header" | Reference Details
|-
|-
! Module
! scope="row" | Module
| {{#if:{{{module|}}}|Module {{{module|}}} — Unit {{{unit|}}}|{{{unit|}}}}}
| {{#if:{{{module|}}}|Module {{{module|}}} — Unit {{{unit|}}}|{{{unit|}}}}}
|-
|-
! Scope
! scope="row" | Scope
| {{{scope|}}}
| {{{scope|}}}
|-
|-
! Document part
! scope="row" | Document part
| {{{doc_part|}}}
| {{{doc_part|}}}
|-
|-
! Language
! scope="row" | Language
| {{{language|}}}
| {{{language|}}}
|-
|-
! Original entry by
! scope="row" | Original entry by
| {{{entry_by|}}}
| {{#if:{{{entry_by|}}}|{{{entry_by|}}}|{{#gplxcreator:}}}}
|-
|-
! Contributors
! scope="row" | Contributors
| {{{contributors|}}}
| {{#if:{{{contributors|}}}|{{{contributors|}}}|{{#gplxcontributors:}}}}
|-
|-
! Tags
! scope="row" | Tags
| {{{tags_display|}}}
| {{{tags_display|}}}
{{#if:{{{comment|}}}|
{{#if:{{{comment|}}}|
|-
{{!}}-
! Comment
! scope="row" {{!}} Comment
| {{{comment|}}}
{{!}} {{{comment|}}}
}}
}}
|}
|}

Latest revision as of 12:33, 19 November 2026

Data template for Reference: pages. Used by Form:Reference. Sets the same SMW properties and renders the same layout that the Excel-based XML import produces (see generate_wiki_xml.py / ref_wikitext()), so existing imported pages can be edited through the form without losing data.

tags holds the raw TAG-ID list (e.g. TAG-00055-Stu-ngs++TAG-00304-Pri-tSt), used for the RefTags SMW property and glossary queries. tags_display holds the resolved, human-readable wikilinks (e.g. [[Glossary:TAG-00055-Stu-ngs|Study design]]) shown in the table — the import script resolves this automatically; when editing by hand, update both together.

RefPreview is derived automatically from content (first 150 characters) and is only used for the preview column in DocumentData's References query — no separate field to fill in.

Original entry by and Contributors: if the field is empty, the values come from the page history of the Reference, like on Document pages (see Template:DocumentData). Accounts listed in MediaWiki:Gplx-excluded-contributors are left out.

has_document accepts the Document name with or without the Document: prefix. The form stores it without the prefix, imported pages carry it. The template adds the prefix when it is missing.

Usage

{{ReferenceData
|has_document=
|module=
|unit=
|scope=
|doc_part=
|language=
|entry_by=
|contributors=
|tags=
|tags_display=
|comment=
|content=
}}