Not logged in
Talk
Contributions
Log in
Navigation
Main page
Recent changes
Random page
Upload file
Module
Discussion
Edit
View history
Editing
Module:Category handler/doc
(section)
From Body Communication
Jump to:
navigation
,
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!
=== Basic usage === This module takes two or more parameters. Here's an example using a hello world program: <syntaxhighlight lang="lua"> p = {} local categoryHandler = require( 'Module:Category handler' ).main function p.main( frame ) local result = 'Hello world!' local category = categoryHandler{ '[[Category:Somecat]]', 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> The above example uses the default settings for the category handler module. That means the example module will categorize on pages in the following namespaces: :'''main''', '''file''', '''help''', '''category''', '''portal''' and '''book''' But it will ''not'' categorize in any other namespaces, e.g.: :'''talk''', '''user''', '''wikipedia''', '''mediawiki''', '''template''' ... And it will ''not'' categorize on blacklisted pages. (See section [[#Blacklist|blacklist]] below.) The reason the category handler module does not categorize in some of the namespaces is that in those namespaces most modules and templates are just demonstrated or listed, not used. Thus most modules and templates should not categorize in those namespaces. Any module or template that is meant for one or more of the namespaces where this module categorizes can use the basic syntax as shown above.
Summary:
Please note that all contributions to Body Communication are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (see
Body Communication: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)
Tools
What links here
Related changes
Special pages
Page information