Editing
Module:FindYDCportal/doc
From Thetacola Wiki
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!
{{Module rating |protected}} {{High-use| 150966 }} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> A helper module to find the most specific chronology [[WP:Portals|portal]] which actually exists for a given year or decade. Used to simplify linking to a chronology portal. ;October 2019 update All by-year and by-century portals have been deleted. There are now only 8 decade portals, listed in [[:Category:Decades portals]]. So all checking for century and year portals has been disabled. If any of the decade portals are deleted, then this module should be edited to remove that decade from the table existingDecadePortals == Parameters == Takes one parameter, which must be either a year (e.g. "1879", "1123") or a decade (e.g. "1940s", "730s"). If the parameter is missing, empty, or does not fit the required format, an empty string is returned. == Output == If a portal is found, returns its name without the namespace prefix, e.g. * for "[[Portal:1980s]]" return <code><nowiki>1980s</nowiki></code> * for "[[Portal:19th century]]" return <code><nowiki>19th century</nowiki></code> If no portal is found, it returns an empty string. == Usage == ;Year parameter <code><nowiki>{{#invoke: FindYDCportal | findydcportal |YYYY}}</nowiki></code> ... where <code><nowiki>YYYY</nowiki></code> is a 3- or 4-digit year ;Decade parameter <code><nowiki>{{#invoke: FindYDCportal | findydcportal |YYY0s}}</nowiki></code> ... where <code><nowiki>YYY0s</nowiki></code> is a 3- or 4-digit decade == Examples == ;Years * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |2018}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |2018}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |1935}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |1935}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |1857}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |1857}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |736}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |736}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |1800}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |1800}} ;Decades * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |2000s}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |2000s}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |1940s}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |1940s}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal |560s}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal |560s}} ;Missing parameter * <code><nowiki>{{#invoke: FindYDCportal | findydcportal}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal}} ;Empty parameter * <code><nowiki>{{#invoke: FindYDCportal | findydcportal | }}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal | }} ;Invalid parameter * <code><nowiki>{{#invoke: FindYDCportal | findydcportal | 1927-related}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal | 1927-related}} * <code><nowiki>{{#invoke: FindYDCportal | findydcportal | Swedish chef}}</nowiki></code> β {{#invoke: FindYDCportal | findydcportal | Swedish chef}} == Logic == If the parameter is a year: # If the year portal exists, return its name.<br>Otherwise try the decade. # If the decade portal exists, return its name.<br>Otherwise try the century # If the century portal exists, return its name.<br>Otherwise return an empty string If the parameter is a decade: # If the decade portal exists, return its name.<br>Otherwise try the century # If the century portal exists, return its name.<br>Otherwise return an empty string == See also == * [[Template:Portal]] * [[Template:Portalbar]] * [[Wikipedia:Portals]] <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly>
Summary:
Please note that all contributions to Thetacola Wiki 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
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:High-use
(
edit
)
Template:Module rating
(
edit
)
Module:Arguments
(
edit
)
Module:FindYDCportal
(
edit
)
Module:High-use
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/F
(
edit
)
Module:Yesno
(
edit
)
Navigation menu
Page actions
Module
Discussion
Read
Edit source
History
Page actions
Module
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information