Template:ReferenceData: Difference between revisions
From GxPlex
Gxplex admin (talk | contribs) Add RefPreview property, auto-derived from content |
Gxplex admin (talk | contribs) Lower RefPreview truncation from 200 to 150 characters |
||
| Line 11: | Line 11: | ||
update both together. | update both together. | ||
<code>RefPreview</code> is derived automatically from <code>content</code> (first | <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 | and is only used for the preview column in [[Template:DocumentData|DocumentData]]'s References | ||
query — no separate field to fill in. | query — no separate field to fill in. | ||
| Line 43: | Line 43: | ||
|RefModule={{{module|}}} | |RefModule={{{module|}}} | ||
|RefUnit={{{unit|}}} | |RefUnit={{{unit|}}} | ||
|RefPreview={{#sub:{{{content|}}}|0| | |RefPreview={{#sub:{{{content|}}}|0|150}}{{#if:{{#expr:{{#len:{{{content|}}}}}>150}}| …|}} | ||
}} | }} | ||
Latest revision as of 14:50, 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 150 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=
}}