Editing
Module:Mainonly
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!
--[[ {{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 OtherX 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
OtherX:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Documentation
(
edit
)
Template:Helper module
(
edit
)
Module:Array
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Helper module
(
edit
)
Module:Mainonly
(
edit
)
Module:Mainonly/doc
(
edit
)
Module:Mw.html extension
(
edit
)
Module:Paramtest
(
edit
)
Module:Tooltip
(
edit
)
Module:Yesno
(
edit
)
This page is a member of a hidden category:
Category:Pages with broken file links
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Module
Discussion
English
Views
Read
Edit source
View history
More
Purge cache
Search
Discord
Discord
Navigation
Main page
About us
Random page
Otherside
Legends of the Mara
Otherside Trips
Otherside Test Events
LOTM Guides & Info
Basics Guide
Hunting Guide
Farming Guide
Enchanting Guide
Game Updates
Oda Information
Quick References
Koda Weapons
Oda Abilities Table
Oda Stats Table
Tools
What links here
Related changes
Special pages
Page information
Page values