Template:Path: Difference between revisions
Jump to navigation
Jump to search
Bug:Characters "<" and ">" can break the template partially. Use <nowiki> as a workaround.
mNo edit summary |
m (automatic icon switching should work now) |
||
Line 19: | Line 19: | ||
}}" style="display:inline-flex; align-items:center; line-height:1.35em"><!-- | }}" style="display:inline-flex; align-items:center; line-height:1.35em"><!-- | ||
--><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:{{#switch:{{{icon}}} | --><span style="position:relative; top:1px">[[File:{{#if:{{{icon|}}}|{{#switch:{{{icon}}} | ||
|#default=icon-folder open-filled.png | |#default=icon-folder open-filled.png | ||
|exe|executable=Icon-Windows_Executable.png | |exe|executable=Icon-Windows_Executable.png | ||
Line 29: | Line 29: | ||
|texture=Icon-Image-filled.png<!-- Texture file will have same icon as image, but the tooltip will remain different.--> | |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 | |generic|file=Icon-File-filled-cropped.png | ||
}}|baseline|alt={{#switch:{{{icon}}} | }}|{{#switch:{{{2}}} | ||
|#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 | |||
}}}}|baseline|alt={{#switch:{{{icon}}} | |||
|#default={{Path/strings|Folder}} | |#default={{Path/strings|Folder}} | ||
|exe=Windows Executable | |exe=Windows Executable |
Revision as of 03:09, 26 July 2023
Todo: Automatic icons (should be case insensitive):
- Use music icon if {{{2}}} is "wav", "mp3", "ogg", "vsnd_c", or any other audio formats.
- Use video icon if {{{2}}} is "bik", "avi", "wmv", "mov", "webm", "mp4", or any other video formats.
- Use picture icon if {{{2}}} is "jpg", "bmp", "tga", "vtf", "vtex_c", "spr", "png", or any other image and texture formats.
- Use executable icon if {{{2}}} is "exe", "bat", "sh", "com", "app", or any other executable applications.
- Otherwise, use generic file icon if {{{2}}} exists.

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.