Template:Document: Difference between revisions
Add automatic categories for documents missing content or orphaned - fixes maintenance queries (via update-page on MediaWiki MCP Server) |
Only render PDF embed for .pdf files; show download link for other file types (zip, etc.) (via update-page on MediaWiki MCP Server) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 14: | Line 14: | ||
{{#arraymap:{{{crt_models|}}}|,|@@@@|{{#set:Has related CRT model=@@@@}}}} | {{#arraymap:{{{crt_models|}}}|,|@@@@|{{#set:Has related CRT model=@@@@}}}} | ||
{{#arraymap:{{{av_devices|}}}|,|@@@@|{{#set:Has related AV device=@@@@}}}} | {{#arraymap:{{{av_devices|}}}|,|@@@@|{{#set:Has related AV device=@@@@}}}} | ||
{{#arraymap:{{{accessories|}}}|,|@@@@|{{#set:Has related accessory=@@@@}}}} | |||
{{#arraymap:{{{parts|}}}|,|@@@@|{{#set:Has related part=@@@@}}}} | |||
[[Category:Documents]] | [[Category:Documents]] | ||
{{#if:{{{file|}}}{{{url|}}}||[[Category:Documents missing content]]}} | {{#if:{{{file|}}}{{{url|}}}||[[Category:Documents missing content]]}} | ||
{{#if:{{{crt_models|}}}{{{av_devices|}}}||[[Category:Orphaned documents]]}} | {{#if:{{{crt_models|}}}{{{av_devices|}}}{{{accessories|}}}{{{parts|}}}||[[Category:Orphaned documents]]}} | ||
</includeonly> | </includeonly> | ||
| Line 48: | Line 50: | ||
|class=wikitable sortable | |class=wikitable sortable | ||
|mainlabel=AV device | |mainlabel=AV device | ||
}}|}}{{#if:{{{accessories|}}}| | |||
<div class="document-section-header"><strong>Related Accessories:</strong></div> | |||
{{#ask: | |||
[[Category:Accessories]] | |||
{{#arraymap:{{{accessories|}}}|,|@@@@|[[@@@@]]|OR}} | |||
|?Has image#100px;x100px=Photo | |||
|?Has model code=Model | |||
|?Has accessory type=Type | |||
|?Has description=Description | |||
|format=table | |||
|class=wikitable sortable | |||
|mainlabel=Accessory | |||
}}|}}{{#if:{{{parts|}}}| | |||
<div class="document-section-header"><strong>Related Parts:</strong></div> | |||
{{#ask: | |||
[[Category:Parts]] | |||
{{#arraymap:{{{parts|}}}|,|@@@@|[[@@@@]]|OR}} | |||
|?Has image#100px;x100px=Photo | |||
|?Has model code=Part # | |||
|?Has part type=Type | |||
|?Has description=Description | |||
|format=table | |||
|class=wikitable sortable | |||
|mainlabel=Part | |||
}}|}}<div class="document-buttons"> | }}|}}<div class="document-buttons"> | ||
{{#if:{{{file|}}}|[{{fullurl:Special:Redirect/file/{{{file}}}}} <span class="document-button document-button-primary">Download</span>]}}{{#if:{{{url|}}}|{{#if:{{{file|}}}||[{{{url}}} <span class="document-button document-button-primary">Download</span>]}}}} [{{fullurl:Special:FormStart|form=Document&page_name={{PAGENAMEE}}}} <span class="document-button document-button-secondary">Edit this data</span>] | {{#if:{{{file|}}}|[{{fullurl:Special:Redirect/file/{{{file}}}}} <span class="document-button document-button-primary">Download</span>]}}{{#if:{{{url|}}}|{{#if:{{{file|}}}||[{{{url}}} <span class="document-button document-button-primary">Download</span>]}}}} [{{fullurl:Special:FormStart|form=Document&page_name={{PAGENAMEE}}}} <span class="document-button document-button-secondary">Edit this data</span>] | ||
| Line 56: | Line 82: | ||
== Document == | == Document == | ||
{{#ifeq:{{lc:{{#sub:{{{file}}}|-4}}}}|.pdf| | |||
<pdf>File:{{{file}}}</pdf> | <pdf>File:{{{file}}}</pdf> | ||
[[File:{{{file}}}|800px]] | [[File:{{{file}}}|800px]] | ||
| | |||
[[:File:{{{file}}}|Download {{{file}}}]] | |||
}} | |||
}} | }} | ||
Latest revision as of 02:59, 14 February 2026
Document
Type: