Template:Wowapi: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(This revision and previous are available under: CC BY-SA 3.0. See list of authors in previous history below.)
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
:<nowiki>{{wowapi}} or {{wowapi|context}} or {{wowapi|t=type}}</nowiki>
* 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.
* 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'.
[[Category:Interface customization templates|{{PAGENAME}}]]
----
;Template
<onlyinclude><div style="float:right; margin-left:2em; margin-bottom:1em">{{apinav}}<!--
-->{{#vardefine:tTYPE|{{#sub:{{PAGENAME}}|0|3}}}}<!--
-->{{#vardefine:tSTYPE|{{#sub:{{PAGENAME}}|4|4}}}}<!--
-->{{#vardefine:tNAME|{{#ifeq:{{#var:tTYPE}}|API|{{#sub:{{PAGENAME}}|{{#switch:{{#var:tSTYPE}}|TYPE=8|#default=4}}|0}}|{{PAGENAME}}}}}}<!--
-->{{#vardefine:tSTYPE|{{lc:{{{t|{{#var:tSTYPE}}}}}}}}}<!--
-->{{#switch:{{#var:tSTYPE}}|member|method={{#vardefine:tNAME|{{#replace:{{#var:tNAME}}|<nowiki> </nowiki>|{{#ifeq:{{#var:tSTYPE}}|member|.|:}}}}}}}}<!--
-->{{#vardefine:tFULLNAME|{{#switch:{{#var:tSTYPE}}|type=API types|#default=World of Warcraft API}}{{#if:{{{1|}}}|/{{{1|}}}}}}}<!--
-->{{#vardefine:tPARENTNAME|{{#switch:{{#var:tSTYPE}}|type={{{1|API}}} types|#default={{{1|WoW}}} API}}}}<!--
--><div style="margin-left: 1em; margin-right: 1em;"><small>&rarr; [[:Category:{{#var:tFULLNAME}}|{{#var:tPARENTNAME}}]]</small></div></div><!--
--><includeonly><!--
  -->{{#ifeq:{{FULLPAGENAME}}|Category:{{#var:tFULLNAME}}||[[Category:{{#var:tFULLNAME}}]]}}<!--
  -->{{#if:{{{nosort|}}}||{{DEFAULTSORT:{{#var:tNAME}}}}}}__NOWYSIWYG__[[ru:Шаблон:WoWAPI]]{{#ifeq:{{#var:tSTYPE}}|type|{{#ifeq:{{{toc|}}}|1||__NOTOC__}}|{{#ifeq:{{{toc|}}}|0||{{tocright}}}}}}<!--
--></includeonly><!--
-->{{#ifeq:{{FULLPAGENAME}}|{{#var:tFULLNAME}}<!--            if is a list page
  -->|{{#ifeq:{{FULLPAGENAME}}|World of Warcraft API||&larr; [[World of Warcraft API|WoW API]]|}}<!--
  -->|&larr; [[{{#var:tFULLNAME}}|{{#var:tPARENTNAME}}]]}}<!--
-->{{#ifeq:{{#var:tTYPE}}|API<!--                            if a list-able API signature or type, put list breadcrumb
  -->|&nbsp;&lt;&nbsp;[[{{#var:tFULLNAME}}#{{#var:tNAME}}|{{#var:tNAME}}]]}}<!--
--></onlyinclude>

Revision as of 05:02, 14 February 2015

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
{{wowapi}} or {{wowapi|context}} or {{wowapi|t=type}}
  • 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.
  • 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'.

Template

WoW API