Template:Path: Difference between revisions
Jump to navigation
Jump to search
Bug:Characters "<" and ">" can break the template partially. Use <nowiki> as a workaround.
m (automatic icon switching should work now) |
m (Properly switch images with {{{2}}} parameter now.) |
||
Line 1: | Line 1: | ||
{{Bug|Characters "<" and ">" can break the template partially. Use {{code|<nowiki><nowiki></nowiki>}} as a workaround.{{todo|Remove unnecessary (redundant) tooltip span that does this.}}}}{{Doc}}<includeonly><onlyinclude><!-- | {{Bug|Characters "<" and ">" can break the template partially. Use {{code|<nowiki><nowiki></nowiki>}} as a workaround.{{todo|Remove unnecessary (redundant) tooltip span that does this.}}}}{{Doc}}<includeonly><onlyinclude><!-- | ||
--><span title="{{#switch:{{{icon}}} | --><span title="{{#switch:{{{icon}}} | ||
Line 20: | Line 14: | ||
--><span style="background-color:{{#if:{{{2|}}}|#984EDDCC|#536FFFCC}}; border-radius:4px 0 0 4px; padding:0 3px 0 4px; user-select:none; pointer-events:none"><!-- | --><span style="background-color:{{#if:{{{2|}}}|#984EDDCC|#536FFFCC}}; border-radius:4px 0 0 4px; padding:0 3px 0 4px; user-select:none; pointer-events:none"><!-- | ||
--><span style="position:relative; top:1px">[[File:{{#if:{{{icon|}}}|{{#switch:{{{icon}}} | --><span style="position:relative; top:1px">[[File:{{#if:{{{icon|}}}|{{#switch:{{{icon}}} | ||
|#default=icon-folder open-filled.png | |||
|exe|executable=Icon-Windows_Executable.png | |||
|reg|regedit|registry|regvalue|regv=Icon-regedit-2D-PathTemplate.png | |||
|custom={{{customico}}} | |||
|audio|sound|music=Icon-Music-Note.png | |||
|video|movie=Icon-Video_File-filled.png | |||
|image|picture=Icon-Image-filled.png | |||
|texture=Icon-Image-filled.png<!-- Texture file will have same icon as image, but the tooltip will remain different.--> | |||
|generic|file=Icon-File-filled-cropped.png | |||
}}|{{#switch:{{{2}}} | }}|{{#switch:{{{2}}} | ||
|#default=icon-folder open-filled.png | |||
|app|bat|com|exe|sh=Icon-Windows_Executable.png | |||
|wav|mp3|ogg|vsnd_c=Icon-Music-Note.png | |||
|avi|bik|mkv|mov|mp4|wmv|webm=Icon-Video_File-filled.png | |||
|apng|bmp|jpg|jpeg|png|spr|tga|tiff|vtf|vtex_c|webp=Icon-Image-filled.png | |||
}}}}|baseline|alt={{#switch:{{{icon}}} | }}}}|baseline|alt={{#switch:{{{icon}}} | ||
|#default={{Path/strings|Folder}} | |||
|exe=Windows Executable | |||
|reg|regedit|registry=Registry Path | |||
|regvalue|regv=Registry Value | |||
|custom=Custom Icon | |||
|audio|sound|music={{Unicode|♪}} | |||
|video|movie={{Unicode|[►]}} | |||
|image|picture={{Path/strings|ImageIconFallback}} | |||
|texture={{Path/strings|TexturesIconFallback}} | |||
|generic|file={{Path/strings|File}} <!-- alt parameter will be used for unicode fallback if the icon doesnt load properly. | |||
Emojis are not recommended as older OS usually may lacking certain emojis.--> | |||
}}|15px]]</span><!-- | }}|15px]]</span><!-- | ||
--></span><!-- | --></span><!-- | ||
--><code style="background-color:rgba({{#if:{{{2|}}}|152,78,221,.25|83,111,255,.25}}); border-radius:0 4px 4px 0; color:#CCC; padding:0 4px; {{#if:{{{select|}}}|user-select:{{{select}}}|}}">{{{1|}}}{{#if:{{{2|}}}|.{{#ifexist: {{{2}}} | [[{{{2}}}]] | {{{2}}} }}|}}</code><!-- | --><code style="background-color:rgba({{#if:{{{2|}}}|152,78,221,.25|83,111,255,.25}}); border-radius:0 4px 4px 0; color:#CCC; padding:0 4px; {{#if:{{{select|}}}|user-select:{{{select}}}|}}">{{{1|}}}{{#if:{{{2|}}}|.{{#ifexist: {{{2}}} | [[{{{2}}}]] | {{{2}}} }}|}}</code><!-- | ||
--></span></onlyinclude></includeonly> | --></span></onlyinclude></includeonly> |
Revision as of 03:17, 26 July 2023

Todo: Remove unnecessary (redundant) tooltip span that does this.
[todo tested in ?]The above documentation is transcluded from Template:Path/doc. (Edit | Page history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.