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

From blackwiki
Jump to navigation Jump to search
test>AfroThundr3007730
(→‎Usage: update docs)
m (15 revisions imported)
 
(3 intermediate revisions by 3 users not shown)
Line 16: Line 16:
  
 
==Examples==
 
==Examples==
'''If the portal contains {{tld|Portal maintenance status|2=manual=yes}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=manual=yes}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}manual=yes}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}manual=yes}}
 
----
 
----
'''If the portal contains {{tld|Portal maintenance status|2=nonstandard=yes}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=nonstandard=yes}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}nonstandard=yes}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}nonstandard=yes}}
 
----
 
----
'''If the portal contains {{tld|Portal maintenance status|2=manual=yes|3=nonstandard=yes}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=incomplete=yes}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}manual=yes{{!}}nonstandard=yes}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}incomplete=yes}}
 
----
 
----
'''If the portal contains {{tld|Portal maintenance status|2=subpages=single}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=subpages=single}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}subpages=single}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}subpages=single}}
 
----
 
----
'''If the portal contains {{tld|Portal maintenance status|2=subpages=checked}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=subpages=checked}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}subpages=checked}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}subpages=checked}}
 
----
 
----
'''If the portal contains {{tld|Portal maintenance status|2=manual=yes|3=nonstandard=yes|4=subpages=single}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=note=This is an example.}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}manual=yes{{!}}nonstandard=yes{{!}}subpages=single}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}note=This is an example.}}
 
----
 
----
'''If the portal contains {{tld|Portal maintenance status|2=manual=yes|3=nonstandard=yes|4=subpages=checked}}'''
+
'''If the portal contains {{tld|Portal maintenance status|2=date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}|3=manual=yes|4=nonstandard=yes|5=subpages=single|6=incomplete=yes|7=note=[[Lorem ipsum]] dolor sit amet.}}'''
  
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}manual=yes{{!}}nonstandard=yes{{!}}subpages=checked}}
+
{{#invoke:Portal maintenance status|main|demo=Portal maintenance status{{!}}date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}{{!}}manual=yes{{!}}nonstandard=yes{{!}}subpages=single{{!}}incomplete=yes{{!}}note=[[Lorem ipsum]] dolor sit amet.}}
 
----
 
----
 
'''If the portal does not contain the template, there should be no output'''
 
'''If the portal does not contain the template, there should be no output'''
Line 50: Line 50:
 
'''If used in the wrong namespace, an error should be reported'''
 
'''If used in the wrong namespace, an error should be reported'''
  
{{#invoke:Portal maintenance status|main}}
+
<!-- {{#invoke:Portal maintenance status|main}}
 +
-->{{large|{{red|'''Lua error: Wrong namespace.'''}}}}
 
----
 
----
  
===See also===
+
==See also==
 
*{{slink|Template:Portal maintenance status/testcases|Module testcases}}
 
*{{slink|Template:Portal maintenance status/testcases|Module testcases}}
 
{{portal templates navbox}}
 
{{portal templates navbox}}

Latest revision as of 17:26, 8 September 2020

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.
{{#invoke:Portal maintenance status|featured}}
Looks for {{Featured portal}} 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|date=June 2026|manual=yes}}


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


If the portal contains {{Portal maintenance status|date=June 2026|incomplete=yes}}


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


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


If the portal contains {{Portal maintenance status|date=June 2026|note=This is an example.}}


If the portal contains {{Portal maintenance status|date=June 2026|manual=yes|nonstandard=yes|subpages=single|incomplete=yes|note=Lorem ipsum dolor sit amet.}}


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: Wrong namespace.


See also

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