Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Cat more if exists
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!
--[[ v1.0 ]] local p = {} local yesno = require("Module:yesno") function p.main(frame) local rawpages = {} local nvalid = 0 local namespace = frame.args.ns for i, v in ipairs(frame:getParent().args) do if (v ~= nil) then local thisArg = mw.text.trim(v) if (thisArg ~= "") then local title = mw.title.new(thisArg, namespace) if title ~= nil and title.exists then table.insert(rawpages, title.fullText) nvalid = nvalid + 1 end end end end if (nvalid == 0) then if yesno(frame.args.warning) then if namespace == nil then namespace = "page" elseif namespace:sub(-1) == "y" then namespace = namespace:sub(0, -2) .. "ie" end mw.addWarning(string.format("'''[[%s]] β no output, because none of the %ss currently exist.'''", frame:getParent():getTitle(),namespace)) end return "" end local mHatnote = require("Module:Hatnote") local mHatList = require("Module:Hatnote list") local options = { extraclasses = "relarticle mainarticle" } local hatnoteText = string.format("For more information, see %s", mHatList.andList(rawpages, true)) return mHatnote._hatnote(hatnoteText, options) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Cat more if exists/doc
(
edit
)