Editing
Module:Category handler/doc
(section)
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!
=== Categories and text === Besides from categories, you can feed anything else to this module, for instance some text. Like this: <syntaxhighlight lang="lua"> p = {} local categoryHandler = require( 'Module:Category handler' ).main function p.main( frame ) local result = 'This is a module used on talk pages.' local category = categoryHandler{ talk = '[[Category:Somecat]]', other = '<p class="error">This module should only be used on talk pages.</p>', nocat = frame.args.nocat -- So "nocat=true/false" works } category = category or '' -- Check that we don't have a nil value for the category variable. return result .. category end return p </syntaxhighlight> When the module code above is used on anything other than a talk page, it will look like this: :This is a module used on talk pages.{{#invoke:category handler|main | talk = [[Category:Somecat]] | other = <p class="error">This module should only be used on talk pages.</p> | nocat = {{{nocat|}}} <!--So "nocat=true/false" works--> }} That text will not show on blacklisted pages, so don't use this method to show any important information. Feeding "<code>nocat = 'true'</code>" to the template hides the text, just as it suppresses any categories.
Summary:
Please note that all contributions to Mirrorplay: Fae are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
MPFae: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
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information