Template:ReferenceData: Difference between revisions
From GxPlex
Gxplex admin (talk | contribs) Add Template:ReferenceData for PageForms  |
Gxplex admin (talk | contribs) Add RefPreview property, auto-derived from content |
||
| 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 200 characters) | |||
and is only used for the preview column in [[Template:DocumentData|DocumentData]]'s References | |||
query — no separate field to fill in. | |||
== Usage == | == Usage == | ||
| Line 39: | Line 43: | ||
|RefModule={{{module|}}} | |RefModule={{{module|}}} | ||
|RefUnit={{{unit|}}} | |RefUnit={{{unit|}}} | ||
|RefPreview={{#sub:{{{content|}}}|0|200}}{{#if:{{#expr:{{#len:{{{content|}}}}}>200}}| …|}} | |||
}} | }} | ||
Revision as of 14:18, 16 July 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 200 characters)
and is only used for the preview column in DocumentData's References
query — no separate field to fill in.
Usage
{{ReferenceData
|has_document=
|module=
|unit=
|scope=
|doc_part=
|language=
|entry_by=
|contributors=
|tags=
|tags_display=
|comment=
|content=
}}