Template:Path: Difference between revisions
Jump to navigation
Jump to search
m (Properly switch images with {{{2}}} parameter now.) |
No edit summary |
||
(47 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{todo|Fall back to generic file icon instead of folder icon if {{param|2}} is present.}} | ||
--><span | {{todo|Icons for models, maps, compressed archives, and uncompressed packages. Syntax exists, and just needs to be uncommented when the icons are ready.}} | ||
{{todo|Icons for linked libraries (DLL, SO, DYLIB).}} | |||
{{todo|Separate designation for compressed vs uncompressed archives.}} | |||
{{Documentation}} | |||
<includeonly> | |||
<onlyinclude><!-- | |||
--><span style="display:inline-flex; align-items:center; line-height:1.35em"><!-- | |||
--><span style="background-color:{{#ifeq:{{{icon|}}}|reg|rgba(100, 145, 230, 0.1)| {{#ifeq:{{{icon|}}}|regv|rgba(100, 145, 230, 0.1)| {{#if:{{{2|}}}|#984EDD20|rgba(230, 145, 100, 0.1)}} }} }};padding:0 3px 0 4px; user-select:none; pointer-events:none"><!-- | |||
--><span style="position:relative; top:{{#if:{{{icon|}}}{{{2|}}}|1px|3px}}"><!-- | |||
-->[[File:{{#if:{{{icon|}}} | |||
| {{#switch: {{lc:{{{icon}}}}} | |||
<!-- if specified, replaces the icon even if the file extension is specified in {{{2}}} --> | |||
| #default = icon-gnome-folder alt.png | |||
| custom = {{{customico}}} | |||
| app|bat|com|exe|sh|executable = Icon-Windows_Executable.png | |||
| apk = Icon-Android.png | |||
| code|c|h|c++|hpp|cpp= Cpp-16px.png | |||
| java|jar= Icon_java.png | |||
| msi|flatpak|installer|setup = Icon-Windows_Installer.png | |||
| reg|regedit|registry|regvalue|regv = Icon-regedit-2D-PathTemplate.png | |||
| audio|sound|music = Icon-Music-Note.png | |||
| fmv|video|movie = Icon-Video_File-filled.png | |||
| image|picture = Icon-Image-filled.png | |||
| 7z|tar.gz|tgz|zip|zipx|rar|vpk|pak = Folder_zip_icon.png | |||
| vmf|hammer= Icon-Hammer_4.x.png | |||
| texture = Icon-Image-filled.png<!-- Texture file currently same icon as image, but the tooltip will remain different --> | |||
<!-- |pak|package=Icon-Package.png --> | |||
<!-- |zip|archive=Icon-Archive.png --> | |||
<!-- |mdl|model=Icon-Model.png --> | |||
<!-- |map=Icon-Map.png --> | |||
| generic|file = Icon-File-filled-cropped.png | |||
}} | |||
| {{#switch: {{lc:{{{2}}}}} | |||
<!-- if the file extension is specified in {{{2}}} and {{{icon}}} was not specified, this will be used --> | |||
| #default = icon-gnome-folder alt.png | |||
Emojis are not recommended as older | | app|bat|com|exe|sh = Icon-Windows_Executable.png | ||
| apk = Icon-Android.png | |||
| java|jar = Icon_java.png | |||
| code|c|h|c++|hpp|cpp = Cpp-16px.png | |||
| msi|flatpak|deb = Icon-Windows_Installer.png | |||
| wav|mp3|ogg|opus|flac|wma|xwv|vsnd_c|sound.cache = Icon-Music-Note.png | |||
| avi|bik|mkv|mov|mp4|wmv|webm|ogv = Icon-Video_File-filled.png | |||
| txt|rtf|wpd = Icon-edit-filled.png | |||
| fxc = Icon-shader.png | |||
| py|pyc = Python-16px.png | |||
| nut|nuc = Sq-highres.png | |||
| lua = Lua-16px.png | |||
| chm = Icon-help.png | |||
| config|cfg=Icon-settings_applications.png | |||
| apng|bmp|jpg|jpeg|pcx|png|tga|tif|tiff|webp|svg|vsvg|vsvg_c = Icon-Image-filled.png | |||
| dds|spr|vtf|vtex_c|wal = Icon-Image-filled.png<!--currently same icon as image--> | |||
| 7z|tar.gz|tgz|zip|zipx|rar|vpk|pak|wad|tar|bz2|pk3 = Folder_zip_icon.png | |||
| vmap = Icon-Hammer_5.x.png | |||
| vmf|vmx|hammer = Icon-Hammer_4.x.png | |||
| rmf|rmx|map = Icon-Hammer_3.x.png | |||
| jmf|jmx = jack_icon.png | |||
<!-- |TAR|tar|PAK|pak|WAD|wad|VPK|vpk = Icon-Package.png --> | |||
<!-- |MDL|mdl|MD2|md2|MD3|md3|VMDL|vmdl|VMDL_C|vmdl_c|PHY|phy|VTX|vtx|VVD|vvd = Icon-Model.png --> | |||
<!-- |BSP|bsp|VMAP_C|vmap_c|VMF|vmf = Icon-Map.png --> | |||
}} | |||
}}|baseline|alt={{#switch: {{lc:{{{icon}}}}} | |||
<!-- fallback if icons are not loaded properly --> | |||
| #default = 🖿 | |||
| custom = Custom Icon | |||
| app|bat|com|exe = Windows Executable | |||
| apk = Android APK | |||
| code= Code | |||
| c++|cpp= C++ code | |||
| h = C++ Header File | |||
| java|jar = Java Executable | |||
| msi = Windows Installer | |||
| flatpak = Flatpak Installer | |||
| installer|setup = Installer | |||
| reg|regedit|registry = Registry Path | |||
| regvalue|regv = Registry Value | |||
| audio|sound|music = 🎜 | |||
| fmv|video|movie = 🎬︎ | |||
| txt|rtf|wpd = Text File | |||
| fxc = Shader File | |||
| image|picture = 🖼{{Path/strings|ImageIconFallback}} | |||
| 7z|tar.gz|tgz|zip|zipx|rar|vpk|pak = 🗂️ (Compressed) | |||
| vmf|hammer = VMF <small>(Valve Map Format)</small> | |||
| texture|tex = {{Path/strings|TexturesIconFallback}} | |||
<!-- |PAK|pak|PACKAGE|package={{Path/strings|PackageIconFallback}} --> | |||
<!-- |ZIP|zip|ARCHIVE|archive={{Path/strings|ArchiveIconFallback}} --> | |||
<!-- |MDL|mdl|MODEL|model={{Path/strings|ModelIconFallback}} --> | |||
<!-- |MAP|map={{Path/strings|MapIconFallback}} --> | |||
| generic|file = {{Path/strings|File}}<!-- alt parameter will be used for Unicode fallback if the icon doesn't load properly. | |||
Emojis are not recommended as older OSes may lack certain emojis.--> | |||
}}|15px|link=]]<!-- | |||
--></span><!-- | |||
--></span><!-- | --></span><!-- | ||
--><code | |||
--></span></onlyinclude></includeonly> | --><code>{{{1|}}}{{#if:{{{2|}}}|.{{#switch: {{lc:{{{2}}}}} | ||
| exe = [[w:.exe|<span style="color:grey">exe</span>]] | |||
| txt = txt | |||
| #default = [[{{lc:{{{2}}}}}|{{{2}}}]]}} | |||
}}</code><!-- | |||
--></span></onlyinclude> | |||
</includeonly> |
Latest revision as of 06:16, 9 May 2025
Todo: Fall back to generic file icon instead of folder icon if {{{2}}} is present.
Todo: Icons for models, maps, compressed archives, and uncompressed packages. Syntax exists, and just needs to be uncommented when the icons are ready.
Todo: Icons for linked libraries (DLL, SO, DYLIB).
Todo: Separate designation for compressed vs uncompressed archives.
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.