Template:Doc/sandbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 21: Line 21:


-->{{#switch:{{{tools|}}}|#default=
-->{{#switch:{{{tools|}}}|#default=
{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }} }}
{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}} }}
|<!--  
|<!--  


view button  
view button  


-->{{#if:{{{content{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}| }}}||<div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-visibility.png|14px|link={{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}|{{int:view}}]]</div></div><!--  
-->{{#if:{{{content| }}}||<div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-visibility.png|14px|link={{{docpage|{{FULLPAGENAME}}/doc}}}|{{int:view}}]]</div></div><!--  


edit button  
edit button  


--><div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-edit.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}|action=edit}}|{{int:edit}}]]</div></div><!--  
--><div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-edit.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=edit}}|{{int:edit}}]]</div></div><!--  


history button  
history button  


--><div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-history.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}|action=history}}|{{int:history}}]]</div></div>}}
--><div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-history.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=history}}|{{int:history}}]]</div></div>}}
|<!--  
|<!--  


create button  
create button  


-->{{#if:{{{content{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}| }}}||<div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div class="plainlinks" style="position: relative; top: -1.5px; ">[{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}|action=edit&preload={{urlencode:{{{docpage|{{#ifexist:{{FULLPAGENAME}}/doc|{{FULLPAGENAME}}/doc|{{#ifexist:Template:Doc/preload{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}|Template:Doc/preload{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }}|Template:Doc/preload}} }} }}} }} }} [[File:Icon-add.png|link=|16px|{{int:create}}]]]</div></div>}} }}
-->{{#if:{{{content|}}}||<div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div class="plainlinks" style="position: relative; top: -1.5px; ">[{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=edit&preload={{urlencode:{{{docpage|{{#ifexist:{{FULLPAGENAME}}/doc|{{FULLPAGENAME}}/doc|{{#ifexist:Template:Doc/preload|Template:Doc/preload|Template:Doc/preload}} }} }}} }} }} [[File:Icon-add.png|link=|16px|{{int:create}}]]]</div></div>}} }}
{{#switch:{{{tools|}}}|#default=
{{#switch:{{{tools|}}}|#default=
<div class="mw-customtoggle-doctools" style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px">'''…'''</div>
<div class="mw-customtoggle-doctools" style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px">'''…'''</div>
Line 53: Line 53:
--></span></div><!--
--></span></div><!--
--></div>
--></div>
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-language" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255, 255, 255, 0.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:text; position:absolute; z-index:1000; right:{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none={{#ifexist:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uselang|pref=/|default-none=1}}|1|0}} }} }}|126px|68px}}; "><!--
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-language" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255, 255, 255, 0.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:text; position:absolute; z-index:1000; right:{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}} }}|126px|68px}}; "><!--
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class=plainlinks><!--
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class=plainlinks><!--



Revision as of 04:32, 13 July 2024

Tip.pngIdea:https://developer.valvesoftware.com/w/index.php?title=Template:Doc/sandbox&oldid=290395
Todo: Exclude Sandbox subpage and other from this template. Also do some code cleanup.
Todo: Fix the document page does not exist bug after changes to MultiPage.
Curly brackets white.png
Red x.png
This template (and its redirect) is Wikipedia icon Deprecated. Its use is not recommended and its functionality may be compromised.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.

Additional notes:
Use #switch parser function instead. Example
{{#switch: {{language}}
| #default = English
| ja = 日本語
| zh-tw = 中文(台灣)
‎}}
Icon-translate.png
View
Edit
Page history
Icon-translate.png
This template uses a strings subpage
Please follow the format on this subpage(s) to add translations.

Header

Test page that uses for testing the new style of the template.

Changes made

  • Added {{{DocParam1}}} ~ {{{DocParam5}}} for /doc page
Useful for pages transcluding from a page and needing a very small change.

Example

{{Doc/sandbox|docpage=abc|DocParam1=Half-Life 2|DocParam2=hl2}}

In a /doc page:

{{ {{{DocParam1|Half-Life 2}}}|4|nt={{{DocParam2|}}} }}

Test parameters