Home
Random
Log in
Settings
About Brighter Shores Wiki
Disclaimers
Search
Editing
Module:Mainonly
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!
--[[ {{Helper module|name=Mainonly |fname1=_main(arg) |ftype1=Any value |fuse1=If the module is invoked in the content namespace, it will return arg, otherwise, it will return an empty string |fname2=on_main() |ftype2=N/A |fuse2=Returns true if invoked in the content namespace, otherwise false }} --]] -- -- Module to return text only when invoked in the content namespace -- local p = {} function p.main(frame) local ret = frame:getParent().args[1] or '' return p._main(ret) end function p._main(text) if mw.title.getCurrentTitle().namespace == 0 then return text else return '' end end -- -- Boolean for whether or not the page is in the mainspace -- Sometimes it might be better to just check first -- Rather than spend processing time on something that won't be used function p.on_main() return mw.title.getCurrentTitle().namespace == 0 end return p
Summary:
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see
Brighter Shores: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)
Preview page with this template
Templates used on this page:
Template:DependencyList
(
edit
)
Template:Documentation
(
edit
)
Template:Extension DPL
(
edit
)
Template:No documentation
(
edit
)
Template:PageType
(
edit
)
Module:Array
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Infobox Class
(
edit
)
Module:Mainonly
(
edit
)
Module:Mainonly/doc
(
edit
)
Module:Paramtest
(
edit
)
Module:References
(
edit
)
Module:Tooltip
(
edit
)
Module:Yesno
(
view source
) (semi-protected)
This page is a member of a hidden category:
Category:Pages using DynamicPageList3 parser function