Template:TruthSocial: Difference between revisions
From Rest of What I Know
Created page with "<includeonly>{{Quote box|class=notheme mw-no-invert|style={{#if: {{{style|}}}|{{{style}}};}} {{#if: {{{block|}}}|margin:1rem 40px;|}}|align={{#if: {{{left|}}}|left|{{#if: {{{block|}}}|none|right}}}}|width={{#if: {{{block|}}}|{{{width|500px}}}|{{{width|220px}}}}}|quote={{#if: {{{name|}}}||{{Formatting error|Missing <u>name</u> parameter.<br />|nocategory={{{nocategory|}}}}}}}<!-- -->{{#if: {{{username|}}}||{{Formatting error|Missing <u>username</u> parameter.<br />|nocat..." |
No edit summary |
||
| Line 21: | Line 21: | ||
|}} | |}} | ||
<th style="text-align: left; white-space: nowrap;">{{{name|}}}</th> | <th style="text-align: left; white-space: nowrap;">{{{name|}}}</th> | ||
<td rowspan="2" style="text-align: right; color: #4C545C; vertical-align: top;">[[File: | <td rowspan="2" style="text-align: right; color: #4C545C; vertical-align: top;">[[File:Truth-logo.png|18px|link=wikipedia:Truth Social|alt=Truth Social logo]]</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Latest revision as of 04:19, 8 October 2025
Template:Template documentation
Purpose[edit]
Formats an embedded card for a post on Truth Social, mirroring {{Tweet}} but without Twitter-specific logic. It supports inline or block layouts, language tagging, optional translation, and a citation to the original post.
Dependencies[edit]
- {{Quote box}}
- {{Formatting error}}
- {{langx}} (or equivalent)
- Module:String (via
)
Parameters[edit]
All parameters are unnamed unless stated.
- Required
name– Display name of the author.username– Handle without the@.text– Post content. Basic wikitext allowed.date– Publication date. Must be DMY (1 Jan 1970) or MDY (Jan 1, 1970).ID/id– Numeric post ID. Required unlessreference/refsupplied.
- Recommended
ref-name– Named reference key (e.g.,Truth_username_ID).
- Optional appearance
block– Set to any non-empty value to use wide block layout (default width 500px).width– Override width. Default 500px when block, 220px when inline.left– Align left when inline. Default is right for inline; ignored for block.style– Extra CSS appended to the quote box.image– Filename of an avatar image to show left of the name (28×28px round).
- Optional context
replyto– Username being replied to (without@).lang/language– BCP-47 code for the post text (e.g.,es,zh-Hans).translation– A translated version shown under a rule.
- Citation control
reference/ref– Raw<ref>...</ref>override. If omitted, a reference is auto-generated with {{cite web}}.cite-id– Value for theref=field inside the auto-generated citation.archive-url,archive-date,url-status– Passed through to {{cite web}}.nocategory– Forwarded to {{Formatting error}} to suppress categorization of formatting errors.
Behavior[edit]
- **Logo:** A 18px logo is shown using a hotlinked SVG:
https://truthsocial.com//instance/images/truth-logo.svg. - **Date format enforcement:** If
dateis not in DMY or MDY, the template emits a formatting error message. - **Reference requirement:** Either
ID/idorreference/refmust be provided. Otherwise a formatting error is shown. - **Auto citation:** If
IDpresent and no customreferenceprovided, a named reference is generated:
*url:https://truthsocial.com/@{{username}}/posts/{{ID}}*title:textcollapsed to single spaces *website: “Truth Social” *date:date*author:name* Archive fields passed through if set.
- **Language:** If
langorlanguageis set, the body is wrapped with {{langx}}.
Examples[edit]
Basic block usage[edit]
{{TruthSocial
| name = Donald J. Trump
| username = realDonaldTrump
| text = Example Truth Social post text here.
| date = Jan 1, 2024
| ID = 123456789012345678
| ref-name = Truth_123456789012345678
| block = yes
}}
Inline card, custom width[edit]
{{TruthSocial
| name = Jane Doe
| username = janedoe
| text = Short update.
| date = 1 Jan 2025
| ID = 9876543210
| width = 260px
}}
With avatar and reply context[edit]
{{TruthSocial
| name = Jane Doe
| username = janedoe
| text = I disagree with that point.
| date = Feb 2, 2025
| ID = 1357911
| image = Jane_Doe_2024.jpg
| replyto = johndoe
| block = true
}}
Language and translation[edit]
{{TruthSocial
| name = María Pérez
| username = maria
| text = Este es un ejemplo.
| date = Mar 3, 2025
| ID = 24680
| lang = es
| translation = This is an example.
}}
Custom reference (no ID)[edit]
{{TruthSocial
| name = Jane Doe
| username = janedoe
| text = Off-platform mirror link.
| date = Apr 4, 2025
| reference = <ref>{{cite web|url=https://example.org|title=Mirror|website=Example|date=Apr 4, 2025}}</ref>
}}
Common errors[edit]
- **Missing name/username/text** → emits {{Formatting error}} with guidance.
- **Missing date** or wrong format → emits a date-format {{Formatting error}}.
- **Missing reference/ID** → emits a {{Formatting error}} instructing to provide
referenceorID.
See also[edit]
TemplateData[edit]
<templatedata> {
"description": "Embed a formatted Truth Social post with optional translation and auto-generated citation.",
"params": {
"name": {
"label": "Name",
"description": "Display name of the author.",
"type": "string",
"required": true
},
"username": {
"label": "Username",
"description": "Truth Social handle without @.",
"type": "string",
"required": true
},
"text": {
"label": "Text",
"description": "Post content.",
"type": "string",
"required": true
},
"date": {
"label": "Date",
"description": "Publication date (DMY or MDY).",
"type": "string",
"required": true,
"example": "Jan 1, 2024"
},
"ID": {
"label": "Post ID",
"description": "Numeric post ID (required unless a custom reference is supplied).",
"type": "number",
"required": false,
"aliases": ["id"]
},
"ref-name": {
"label": "Reference name",
"description": "Name for the generated reference.",
"type": "string",
"required": false
},
"reference": {
"label": "Custom reference",
"description": "Override the generated citation with a custom [1].",
"type": "string",
"required": false,
"aliases": ["ref"]
},
"cite-id": {
"label": "Cite ref id",
"description": "Value passed to the ref= field of cite web.",
"type": "string",
"required": false
},
"image": {
"label": "Avatar image",
"description": "Local file name to show as a circular 28px avatar.",
"type": "string",
"required": false
},
"replyto": {
"label": "Replying to",
"description": "Username being replied to, without @.",
"type": "string",
"required": false
},
"lang": {
"label": "Language",
"description": "BCP-47 language code for the text.",
"type": "string",
"required": false,
"aliases": ["language"]
},
"translation": {
"label": "Translation",
"description": "Translated text shown beneath the post.",
"type": "string",
"required": false
},
"block": {
"label": "Block layout",
"description": "Non-empty to enable wide block layout.",
"type": "string",
"required": false
},
"width": {
"label": "Width",
"description": "Overrides default width (500px block, 220px inline).",
"type": "string",
"required": false,
"example": "480px"
},
"left": {
"label": "Left align",
"description": "When inline, align left instead of right.",
"type": "string",
"required": false
},
"style": {
"label": "Extra styles",
"description": "Additional CSS applied to the quote box.",
"type": "string",
"required": false
},
"archive-url": {
"label": "Archive URL",
"description": "Archive link passed to cite web.",
"type": "string",
"required": false
},
"archive-date": {
"label": "Archive date",
"description": "Archive date passed to cite web.",
"type": "string",
"required": false
},
"url-status": {
"label": "URL status",
"description": "URL status for cite web (e.g., 'live', 'dead').",
"type": "string",
"required": false
},
"nocategory": {
"label": "No category",
"description": "If set, suppresses error categories from Formatting error.",
"type": "string",
"required": false
}
}
} </templatedata>
- ↑ …
