API:Templates
Jump to navigation
Jump to search
| Templates | ||
|---|---|---|
| Returns all templates from the given page(s). This module can be used as a Generator. |
||
| Prefix | tl | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Gets a list of all pages (typically templates) transcluded in the provided pages. This module can be used as a generator.
Parameters[edit]
tlnamespace: Only list pages in these namespaces.tllimit: How many templates to return. No more than 500 (5000 for bots) allowed. (Default: 10) 1.13+tlcontinue: When more results are available, use this to continue. 1.13+tltemplates: Only list these templates. Useful to check whether a certain template is transcluded in a certain page. 1.17+tldir: The direction in which to list. Possible values:ascending,descending. 1.19+
Example[edit]
Get a list of templates used on en:Albert Einstein's page
| Result |
|---|
<api>
<query>
<pages>
<page pageid="736" ns="0" title="Albert Einstein">
<templates>
<tl ns="10" title="Template:Academia" />
<tl ns="10" title="Template:Age at date" />
<tl ns="10" title="Template:Audio" />
<tl ns="10" title="Template:Birth date" />
...
</templates>
</page>
</pages>
</query>
</api>
|
Possible errors[edit]
None.