Difference between revisions of "Module:Portal maintenance status/doc"

From blackwiki
Jump to navigation Jump to search
test>Evad37
(historical function)
test>Evad37
(no longer looks for deprecated, deleted templates)
Line 6: Line 6:
 
== Usage ==
 
== Usage ==
 
;<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''main''}}</code>
 
;<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''main''}}</code>
:Looks for {{tl|Portal maintenance status}} (or earlier deprecated templates) on a Portal_talk: page's related portal page.
+
:Looks for {{tl|Portal maintenance status}} on a Portal_talk: page's related portal page.
 
:Returns an appropriate message string if found or an empty string if not found, or an error if used in the wrong namespace.
 
:Returns an appropriate message string if found or an empty string if not found, or an error if used in the wrong namespace.
 
;<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''historical''}}</code>
 
;<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''historical''}}</code>
Line 48: Line 48:
  
 
{{#invoke:Portal maintenance status|main}}
 
{{#invoke:Portal maintenance status|main}}
----
 
 
===Deprecated examples===
 
'''''If the portal contains ''{{tld|Maintained portal flag}}'':'''''
 
 
{{#invoke:Portal maintenance status|main|demo=Maintained portal flag}}
 
----
 
'''''If the portal contains ''{{tld|Non-standard portal flag}}'':'''''
 
 
{{#invoke:Portal maintenance status|main|demo=Non-standard portal flag}}
 
----
 
'''''If the portal contains both ''{{tld|Maintained portal flag}}'' and ''{{tld|Non-standard portal flag}}'':'''''
 
 
{{#invoke:Portal maintenance status|main|demo=Maintained portal flag|demo2=Non-standard portal flag}}
 
 
----
 
----
  

Revision as of 05:07, 16 June 2018

This module searches a Portal_talk: page's portal page, and returns an appropriate message based if {{Portal maintenance status}} is found in the page's wikitext, and which parameters are used. An error is reported if this module is used outside of the Portal_talk namespace. It can be demonstrated, in any namespace, with the |demo= and |demo2= parameters, which take the name of templates to "find" (instead of actually searching a page).

Usage

{{#invoke:Portal maintenance status|main}}
Looks for {{Portal maintenance status}} on a Portal_talk: page's related portal page.
Returns an appropriate message string if found or an empty string if not found, or an error if used in the wrong namespace.
{{#invoke:Portal maintenance status|historical}}
Looks for {{Historical}} on a Wikipedia_talk: page's related project page.
Returns yes if found or an empty string if not found, or an error if used in the wrong namespace.

Examples

If the portal contains {{Portal maintenance status|manual=yes}}


If the portal contains {{Portal maintenance status|nonstandard=yes}}


If the portal contains {{Portal maintenance status|manual=yes|nonstandard=yes}}


If the portal contains {{Portal maintenance status|subpages=single}}


If the portal contains {{Portal maintenance status|subpages=checked}}


If the portal contains {{Portal maintenance status|manual=yes|nonstandard=yes|subpages=single}}


If the portal contains {{Portal maintenance status|manual=yes|nonstandard=yes|subpages=checked}}


If the portal does not contain the template, there should be no output



If used in the wrong namespace, an error should be reported

Lua error in Module:Portal_maintenance_status at line 45: attempt to index field '?' (a nil value).


See also

  • Script error: No such module "Section link".