This module detects if a given page is a disambiguation page.
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
| This Lua module is used in system messages, and on approximately 23,000 pages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
| This module depends on the following other modules: |
This module detects if a given page is a disambiguation page.
{{#invoke:Disambiguation|isDisambiguationPage|Page title}}
yes if the page is a disambiguation page, or nothing if the page is not a disambiguation pageExamples:
{{#invoke:Disambiguation|isDisambiguationPage|Paris}} →{{#invoke:Disambiguation|isDisambiguationPage|New}} → yes{{#invoke:Disambiguation|isDisambiguationPage|Black swan (disambiguation)}} → yesYou can also use magic words like {{SUBJECTPAGENAME}}:
{{#invoke:Disambiguation|isDisambiguationPage|{{SUBJECTPAGENAME}}}} →Import this module, e.g. with
local mDisambiguation = require('Module:Disambiguation')
Then you can use the functions isDisambiguation and _isDisambiguationPage.
If you have already have a Title object for the page to check, get the content using the title object's getContent() method, and pass that into isDisambiguation:
local isDab = mDisambiguation.isDisambiguation(content) -- returns true or false
content is a string, the wikitext content of page to check)If you don't otherwise need the title, you can pass in the page name to _isDisambiguationPage:
local isDab = mDisambiguation._isDisambiguationPage(pageName) -- returns true or false
pageName is a string, the name of page to check)Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.