Module:Transclusion count/sandbox
Appearance
![]() | This is the module sandbox page for Module:Transclusion count (diff). |
![]() | This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
![]() | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
![]() | This Lua module is used on approximately 60,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
Fetches usage data for highly-transcluded templates. Uses bot-updated values from subpages of Module:Transclusion_count/data/ when available.
Usage
{{#invoke:Transclusion count|fetch|number of transclusions|use + notation|all-pages=|demo=}}
number of transclusions
: is a static number of times the template has been transcluded, to use when values cannot be read from the database. This value will be ignored if transclusion data is available for the current page.demo=Template_name
: will use the transclusion count for the template at Template:Template_name instead of detecting what template it is being used on. Capitalization must exactly match the value used in Special:PrefixIndex/Module:Transclusion_count/data/.
{{#invoke:Transclusion count|tabulate}}
- Used to generate Wikipedia:Database reports/Templates transcluded on the most pages.
Notices
- The number of transclusion count is generated via subpages of Module:Transclusion count/data when is available and is automatically updated via a bot.
local p = {}
function p.main()
local template = mw.title.getCurrentTitle().text
local index = mw.ustring.sub(template,1,1)
local data = mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other"))
return data[mw.ustring.gsub(template, '"', '"')]
end
return p