Template:Wowapi: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
Use this at the top of all global WoW API pages. This template mostly just floats {{t|apinav}} table to the right and adds categories. | |||
Any pages with this template will be added to [[:Category:World of Warcraft API]] or Category:World of Warcraft API/sub-page. See [[World of Warcraft API]]. See also [[Template:Widget]], [[Template:Framexml]]. | |||
;Usage | |||
* 1 - API context type, like 'Glue'. Default is regular game play UI context. Affects wiki categories and page parent folder. Used by 'Glue' environment API. | |||
* t - [member, method, type] - identifier type for page, like if page subject is an general topic, object, method, or regular member or type. | |||
* removed - patch number removed in. See also [[Template:WoW/removedapi]] | |||
* replace - text explaining what to use if removed, replaced or deprecated. | |||
* toc - [0,1] - Force TOC enabled or disabled. Default depends on type. | |||
;Examples | |||
* <code><nowiki>{{wowapi|Glue}}</nowiki></code> - 'World of Warcraft API/Glue', 'Category:World of Warcraft API/Glue' | |||
* <code><nowiki>{{wowapi|t=method}}</nowiki></code> - 'API AuctionFrameAuction duration', displays link as 'AuctionFrameAuction:duration'. | |||
* <code><nowiki>{{wowapi|t=member}}</nowiki></code> - 'API AuctionFrameAuction duration', displays link as 'AuctionFrameAuction.duration'. | |||
* <code><nowiki>{{wowapic}}</nowiki></code> - 'API C EquipmentSet UseEquipmentSet', displays link as 'C_EquipmentSet.UseEquipmentSet'. | |||
[[Category:Interface customization templates|{{PAGENAME}}]] | |||
---- | |||
;Template | |||
<onlyinclude><includeonly>__NOWYSIWYG__<!-- | |||
-->{{#if:{{{removed|}}}|{{WoW/removedapi|{{{removed|}}}|{{{replace|}}}}}}}<!-- | |||
--><div style="float:right; margin-left:2em; margin-bottom:1em">{{apinav|toc={{{toc|}}}}}<!-- do vars after apinav so not conflict | |||
API TYPE UnitId | |||
API SomeWidget SomeMember | |||
API SomeWidget SomeMethod | |||
API C EquipmentSet UseEquipmentSet | |||
-->{{#vardefine:tNAME|{{PAGENAME}}}}<!-- fixed-up display name without disambig prefixes | |||
-->{{#vardefine:tTYPE|{{#sub:{{PAGENAME}}|0|4}}}}<!-- page type 'API ' - whitespace gets trimmed | |||
-->{{#ifeq:{{#var:tTYPE}}|API|<!-- | |||
-->{{#vardefine:tSTYPE|{{#sub:{{PAGENAME}}|3|5}}}}<!-- page sub-type ' TYPE ' | |||
-->{{#vardefine:tNSTART|{{#ifeq:{{#var:tSTYPE}}|TYPE|8|4}}}}<!-- start of first real name | |||
-->{{#vardefine:tNAME|{{#sub:{{#var:tNAME}}|{{#var:tNSTART}}}}}}<!-- to start of name without disambig | |||
-->{{#vardefine:tCTYPE|{{#sub:{{#var:tNAME}}|0|2}}}}<!-- page api container type 'C ' | |||
-->{{#ifeq:{{#var:tCTYPE}}|C|{{#vardefine:tNAME|C_{{#sub:{{#var:tNAME}}|2}}}}}}<!-- ' ' to '_' | |||
-->}}<!-- | |||
-->{{#vardefine:tSTYPE|{{lc:{{{t|{{#var:tSTYPE}}}}}}}}}<!-- parameter or automatic by page name for type | |||
-->{{#switch:{{#var:tSTYPE}}<!-- make name a fully qualified member or method | |||
-->|member|method={{#vardefine:tNAME|{{#replace:{{#var:tNAME}}|<nowiki> </nowiki>|{{#ifeq:{{#var:tSTYPE}}|member|.|:}}}}}}<!-- | |||
-->}}<!-- | |||
'World of Warcraft API' 'API types' 'World of Warcraft API/Glue' 'API types/Glue' full version of parent page name | |||
-->{{#vardefine:tPPAGE|{{#switch:{{#var:tSTYPE}}|type=API types|#default=World of Warcraft API}}{{#if:{{{1|}}}|/{{{1|}}}}}}}<!-- | |||
'WoW API' 'API types' 'Glue API' 'Glue types' short version of parent page name | |||
-->{{#vardefine:tPNAME|{{#switch:{{#var:tSTYPE}}|type={{{1|API}}} types|#default={{{1|WoW}}} API}}}}<!-- | |||
--><div style="margin-left: 1em; margin-right: 1em;"><!-- cat link at bottom of api navbox | |||
--><small>→ [[:Category:{{#var:tPPAGE}}|{{#var:tPNAME}}]]</small></div><!-- | |||
--></div><!-- | |||
-->{{#ifeq:{{FULLPAGENAME}}|Category:{{#var:tPPAGE}}||[[Category:{{#var:tPPAGE}}]]}}<!-- skip adding cat on actual cat page | |||
-->{{#if:{{{nosort|}}}||{{DEFAULTSORT:{{#var:tNAME}}}}}}<!-- | |||
-->{{#ifeq:{{#var:tSTYPE}}|type|{{#ifeq:{{{toc|}}}|1||__NOTOC__}}<!-- | |||
-->|{{#ifeq:{{{toc|}}}|0|__NOTOC__|{{#ifeq:{{{tocright|1}}}|0||{{tocright}}}}}}}}<!-- toc style | |||
-->{{#ifeq:{{FULLPAGENAME}}|{{#var:tPPAGE}}||<!-- if we are not actual parent page, a list page | |||
-->{{DISPLAYTITLE:WoW {{{1|}}} {{#ifeq:{{#var:tSTYPE}}|type|API type:|API:}} {{#var:tNAME}}}}<!-- | |||
-->}}<!-- | |||
-->{{#ifeq:{{FULLPAGENAME}}|{{#var:tPPAGE}}<!-- if we are actual parent page, a list page | |||
-->|{{#ifeq:{{FULLPAGENAME}}|World of Warcraft API||← [[World of Warcraft API|WoW API]]|}}<!-- if top level don't render | |||
-->|← [[{{#var:tPPAGE}}|{{#var:tPNAME}}]]<!-- | |||
-->}}<!-- | |||
-->{{#switch:{{#var:tTYPE}}<!-- if a list-able API signature or type, put list breadcrumb | |||
-->|API= < [[{{#var:tPPAGE}}#{{#var:tNAME}}|{{#var:tNAME}}]]}}<!-- | |||
tTYPE ({{#var:tTYPE}}) | |||
--></includeonly></onlyinclude> |
Latest revision as of 05:13, 13 February 2021
Use this at the top of all global WoW API pages. This template mostly just floats {{apinav}} table to the right and adds categories.
Any pages with this template will be added to Category:World of Warcraft API or Category:World of Warcraft API/sub-page. See World of Warcraft API. See also Template:Widget, Template:Framexml.
- Usage
- 1 - API context type, like 'Glue'. Default is regular game play UI context. Affects wiki categories and page parent folder. Used by 'Glue' environment API.
- t - [member, method, type] - identifier type for page, like if page subject is an general topic, object, method, or regular member or type.
- removed - patch number removed in. See also Template:WoW/removedapi
- replace - text explaining what to use if removed, replaced or deprecated.
- toc - [0,1] - Force TOC enabled or disabled. Default depends on type.
- Examples
{{wowapi|Glue}}
- 'World of Warcraft API/Glue', 'Category:World of Warcraft API/Glue'{{wowapi|t=method}}
- 'API AuctionFrameAuction duration', displays link as 'AuctionFrameAuction:duration'.{{wowapi|t=member}}
- 'API AuctionFrameAuction duration', displays link as 'AuctionFrameAuction.duration'.{{wowapic}}
- 'API C EquipmentSet UseEquipmentSet', displays link as 'C_EquipmentSet.UseEquipmentSet'.
- Template