Editing
Module:Broader
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
--[[ -- This module produces a "For a broader coverage related to this topic" link. It implements -- the {{broader}} template. --]] local mHatlist = require('Module:Hatnote list') local mHatnote = require('Module:Hatnote') local mArguments -- lazily initialize local mTableTools --lazily initialize local p = {} local s = { --localizable strings broaderForm = 'For broader coverage of %s, see %s.', defaultTopic = 'this topic' } function p.broader(frame) mArguments = require('Module:Arguments') mTableTools = require('Module:TableTools') local originalArgs = mArguments.getArgs(frame, {parentOnly = true}) local args = mTableTools.compressSparseArray(originalArgs) -- re-add non-numeric arguments omitted by compressSparseArray for _, name in pairs({'category', 'selfref', 'topic'}) do args[name] = originalArgs[name] end return p._broader(args) end function p._broader(args) if not args[1] then return mHatnote.makeWikitextError( 'no page name specified', 'Template:Broader#Errors', args.category ) end local list = mHatlist.andList(args, true) local topic = args.topic or s.defaultTopic local text = string.format(s.broaderForm, topic, list) options = {selfref = args.selfref} return mHatnote._hatnote(text, options) end return p
Summary:
Please note that all contributions to Ikwipedia are considered to be released under the Creative Commons Attribution-ShareAlike (see
Ikwipedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Module
Discussion
English
Views
Read
Edit source
View history
More
Move
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information