Template:Files: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
A template for rendering files into view switching between galleries and other view.
A template for rendering files into view switching between galleries and other view in closed knowledge portals.
== Simple file ==
<pre><nowiki>{{Files|files=JustLogo.svg}}</nowiki></pre>

{{Files|files=JustLogo.svg}}
== Multiple files ==
<pre><nowiki>{{Files|files=JustLogo.svg;Fox on shelf.jpg}}</nowiki></pre>

{{Files|files=JustLogo.svg;Fox on shelf.jpg}}
== Office files ==
If the template [[Template:ExternalOfficeRenderer|ExternalOfficeRenderer]] exists the office file will be rendered using the url in the template. Otherwise the office file type icon will be used.
<pre><nowiki>{{Files|files=על המערכת.docx}}</nowiki></pre>

{{Files|files=על המערכת.docx}}

</noinclude>
</noinclude>
<includeonly>{{#if:{{#explode:{{{files|}}}|;|1}}|
<includeonly>{{#if:{{{files|}}}|{{#if:{{#explode:{{{files|}}}|;|1}}|
{{#tag:gallery
{{#tag:gallery
|{{#arraymap:{{{files|}}}; {{{file|}}}|;|xx|File:xx{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}|\n\n}} }}
|{{#arraymap:{{{files|}}}; {{{file|}}}|;|xx|{{#switch:{{#explode:xx|.|-1}}
|docx = File:Microsoft_Office_Word_(2019–present).svg{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
{{#switch:{{#explode:{{{files|}}}|.|-1}}
|doc = File:Microsoft_Office_Word_(2019–present).svg{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
|docx = https://view.officeapps.live.com/op/embed.aspx?src={{SERVER}}{{filepath:{{{files|}}}}}
|pptx = File:Microsoft_Office_PowerPoint_(2019–present).svg{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
|doc = https://view.officeapps.live.com/op/embed.aspx?src={{SERVER}}{{filepath:{{{files|}}}}}
|ppt = File:Microsoft_Office_PowerPoint_(2019–present).svg{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
|pptx = https://view.officeapps.live.com/op/embed.aspx?src={{SERVER}}{{filepath:{{{files|}}}}}
|xls = File:Microsoft_Office_Excel_(2019–present).svg{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
|ppt = https://view.officeapps.live.com/op/embed.aspx?src={{SERVER}}{{filepath:{{{files|}}}}}
|xlsx = File:Microsoft_Office_Excel_(2019–present).svg{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
|xlsx = https://view.officeapps.live.com/op/embed.aspx?src={{SERVER}}{{filepath:{{{files|}}}}}
|#default = File:xx{{!}}{{#explode:xx|.|0}}{{!}}link={{filepath:xx}}
|xls = https://view.officeapps.live.com/op/embed.aspx?src={{SERVER}}{{filepath:{{{files|}}}}}
}}|\n\n}} }}<div class="d-none"><!-- embed files, you know for search -->{{#arraymap:{{{files|}}}; {{{file|}}}|;|xx|{{#switch:{{#explode:xx|.|-1}}
||[[file:{{{files|}}}|650px|thumb|center|{{{files|}}} [[media:{{{files|}}}|{{i|download|tooltip={{:mediawiki:download}}]] ]]
|docx = [[File:xx]]
|doc = [[File:xx]]
|pptx = [[File:xx]]
|ppt = [[File:xx]]
|xls = [[File:xx]]
|xlsx = [[File:xx]]
|#default =
}}|}}</div>
|{{#switch:{{#explode:{{{files|}}}|.|-1}}
|docx = {{#ifexist:Template:ExternalOfficeRenderer|{{ExternalOfficeRenderer|path={{{files|{{{file|}}}}}}|height-ratio=4|width-ratio=3}}|[[File:Microsoft_Office_Word_(2019–present).svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|doc = {{#ifexist:Template:ExternalOfficeRenderer|{{ExternalOfficeRenderer|path={{{files|{{{file|}}}}}}|height-ratio=4|width-ratio=3}}|[[File:Microsoft_Office_Word_(2019–present).svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|pptx = {{#ifexist:Template:ExternalOfficeRenderer|{{ExternalOfficeRenderer|path={{{files|{{{file|}}}}}}}}|[[File:Microsoft_Office_PowerPoint_(2019–present).svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|ppt = {{#ifexist:Template:ExternalOfficeRenderer|{{ExternalOfficeRenderer|path={{{files|{{{file|}}}}}}}}|[[File:Microsoft_Office_PowerPoint_(2019–present).svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|xls = {{#ifexist:Template:ExternalOfficeRenderer|{{ExternalOfficeRenderer|path={{{files|{{{file|}}}}}}}}|[[File:Microsoft_Office_Excel_(2019–present).svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|xlsx = {{#ifexist:Template:ExternalOfficeRenderer|{{ExternalOfficeRenderer|path={{{files|{{{file|}}}}}}}}|[[File:Microsoft_Office_Excel_(2019–present).svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|pdf = {{#ifexist:widget:ViewerJs|<div class="pdf text-center Fennec-embed-wrp Fennec-embed-name-youtube">{{#widget:ViewerJs|path={{filepath:{{{files|{{{file|}}}}}}}}}}|[[File:Icon-pdf.svg|center|thumb|200px|link={{filepath:{{{files|}}}}}|{{{files|}}}]]}}<span class="d-none">[[file:{{{files|}}}|thumb|class=d-none]]</span>
|#default = [[file:{{{files|}}}|650px|thumb|center|{{{files|}}} [[media:{{{files|}}}|{{:mediawiki:download}}]] ]]
}}
}}
}}}}
</includeonly><noinclude>
</includeonly><noinclude>
<templatedata>
<templatedata>
Line 19: Line 51:
"params": {
"params": {
"files": {
"files": {
"label": "File of Files name",
"label": "List of Files name",
"type": "wiki-file-name",
"type": "wiki-file-name",
"required": true,
"required": true,

Latest revision as of 18:54, 5 May 2025

A template for rendering files into view switching between galleries and other view in closed knowledge portals.

Simple file

{{Files|files=JustLogo.svg}}


JustLogo.svg download

Multiple files

{{Files|files=JustLogo.svg;Fox on shelf.jpg}}


Office files

If the template ExternalOfficeRenderer exists the office file will be rendered using the url in the template. Otherwise the office file type icon will be used.

{{Files|files=על המערכת.docx}}


File:על המערכת.docx



A template for rendering files into view switching between galleries and other view.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
List of Files namefiles

no description

Filerequired
filefile

no description

Unknownoptional