Home
Random
Recent changes
Special pages
Community portal
Preferences
About Real-Life Villains
Disclaimers
Real-Life Villains
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Category handler/doc
(section)
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 Real-Life Villains 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
Real-Life Villains:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)