→Portal bar. Separate bar for "See also" sections: and rm there
|
m syntaxhighlight lang="wikitext"
|
||
(21 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
{{High-use|11679}} |
{{High-use|11679}} |
||
{{lua|Module:Subject bar|Module:Portal}} |
|||
This navigational template offers a variant to several floating box templates that link to [[Portal:Contents/Portals|portals]], and [[Wikipedia:Wikimedia sister projects|Wikipedia's sister projects]] but also typically cause formatting issues because of their size and alignment. |
This navigational template offers a variant to several floating box templates that link to [[Portal:Contents/Portals|portals]], and [[Wikipedia:Wikimedia sister projects|Wikipedia's sister projects]] but also typically cause formatting issues because of their size and alignment. |
||
It is intended to be placed at the end of an article, '''after''' the references, external links, navboxes |
It is intended to be placed at the end of an article, '''after''' the references, external links, navboxes and '''before''' any authority control template or [[WP:Category|categories]]. |
||
{{Lua|Module:Subject bar}} |
|||
{{Uses TemplateStyles|Template:Subject bar/styles.css}} |
|||
== Usage == |
== Usage == |
||
Line 29: | Line 25: | ||
; All parameters, horizontal. Parameters in order they show up in subject bar. |
; All parameters, horizontal. Parameters in order they show up in subject bar. |
||
: <code><nowiki>{{Subject bar|commons = y |
: <code><nowiki>{{Subject bar|commons = y|species = y|voy = y|n = y|wikt = y|b = y|q = y|s = y|v = y|d = y|portal = }}</nowiki></code> |
||
; All parameters, horizontal. In alphabetical order |
; All parameters, horizontal. In alphabetical order, except for <code>portal</code> which is often removed. |
||
: <code><nowiki>{{Subject bar|b |
: <code><nowiki>{{Subject bar|b = |commons = |d = |n = |q = |s = |species = |v = |voy = |wikt = |portal = }}</nowiki></code> |
||
; All parameters, vertical. In alphabetical order |
; All parameters, vertical. In alphabetical order, except for <code>portal</code> which is often removed. |
||
< |
<syntaxhighlight lang="wikitext">{{Subject bar |
||
|b = |
|b = |
||
|b-search = |
|||
|commons = |
|commons = |
||
|commons-search = |
|||
|d = |
|d = |
||
|d-search = |
|||
|n = |
|n = |
||
|n-search = |
|||
|q = |
|q = |
||
|q-search = |
|||
|s = |
|s = |
||
|s-search = |
|||
|species = |
|species = |
||
|species-search = |
|||
|v = |
|v = |
||
|v-search = |
|||
|voy = |
|voy = |
||
| |
|wikt = |
||
|wikt = |
|||
|wikt-search = |
|||
|portal = |
|portal = |
||
}}</syntaxhighlight> |
|||
|spoken = |
|||
}}</pre> |
|||
== Parameters explained == |
== Parameters explained == |
||
{{col |
{{div col|colwidth=30em}} |
||
; <kbd><nowiki>b</nowiki></kbd>: [[Wikibooks:|Wikibooks]] page to link to, "yes" means use wikidata to search for page |
|||
{{col-break|width=50%}} |
|||
; <kbd><nowiki> |
; <kbd><nowiki>commons</nowiki></kbd>: [[commons:|WikiMedia Commons]] page (or Category:) to link to, "yes" means use wikidatatosearch for page |
||
; <kbd><nowiki> |
; <kbd><nowiki>d</nowiki></kbd>: [[d:|Wikidata]] page to link to, "yes" means use wikidata to search for page |
||
; <kbd><nowiki> |
; <kbd><nowiki>n</nowiki></kbd>: [[wikinews:|Wikinews]] page to link to, "yes" means use wikidatatosearch for page |
||
; <kbd><nowiki> |
; <kbd><nowiki>q</nowiki></kbd>: [[wikiquote:|Wikiquote]] page to link to, "yes" means use wikidata to search for page |
||
; <kbd><nowiki>s</nowiki></kbd>: [[wikisource:|Wikisource]] page (or Author:) to link to, "yes" means use wikidata to search for page |
|||
: To search by category, start with <code><nowiki>Category:</nowiki></code> |
|||
; <kbd><nowiki> |
; <kbd><nowiki>species</nowiki></kbd>: [[species:|Wikispecies]] page to link to, "yes" means use wikidata to search for page |
||
; <kbd><nowiki> |
; <kbd><nowiki>v</nowiki></kbd>: [[wikiversity:|Wikiversity]] page to link to, "yes" means use wikidata to search for page |
||
; <kbd><nowiki> |
; <kbd><nowiki>voy</nowiki></kbd>: [[voy:|Wikivoyage]] page to link to, "yes" means use wikidata to search for page |
||
; <kbd><nowiki> |
; <kbd><nowiki>wikt</nowiki></kbd>: [[wiktionary:|Wiktionary]] page to link to, "yes" means use wikidata to search for page |
||
{{div col end}} |
|||
; <kbd><nowiki>q</nowiki></kbd>: Setting any value for this parameter will result in a link to [[wikiquote:|Wikiquote]] |
|||
; <kbd><nowiki>q-search</nowiki></kbd>: To replace the default (article name) search string |
|||
{{col-break}} |
|||
; <kbd><nowiki>s</nowiki></kbd>: Setting any value for this parameter will result in a link to [[wikisource:|Wikisource]] |
|||
; <kbd><nowiki>s-search</nowiki></kbd>: To replace the default (article name) search string |
|||
: To search by author, start with <code><nowiki>Author:</nowiki></code> |
|||
; <kbd><nowiki>species</nowiki></kbd>: Setting any value for this parameter will result in a link to [[species:|Wikispecies]] |
|||
; <kbd><nowiki>species-search</nowiki></kbd>: To replace the default (article name) search string |
|||
; <kbd><nowiki>v</nowiki></kbd>: Setting any value for this parameter will result in a link to [[wikiversity:|Wikiversity]] |
|||
; <kbd><nowiki>v-search</nowiki></kbd>: To replace the default (article name) search string |
|||
; <kbd><nowiki>voy</nowiki></kbd>: Setting any value for this parameter will result in a link to [[voy:|Wikivoyage]] |
|||
; <kbd><nowiki>voy-search</nowiki></kbd>: To replace the default (article name) search string |
|||
; <kbd><nowiki>wikt</nowiki></kbd>: Setting any value for this parameter will result in a link to [[wiktionary:|Wiktionary]] |
|||
; <kbd><nowiki>wikt-search</nowiki></kbd>: To replace the default (article name) search string |
|||
{{col-end}} |
|||
=== Other parameters === |
=== Other parameters === |
||
; <kbd><nowiki>portal</nowiki></kbd>: Use <code><nowiki> |
; <kbd><nowiki>portal</nowiki></kbd>: Use <code><nowiki>portal###</nowiki></code> where ### is any number to link to a portal |
||
; <kbd><nowiki> |
; <kbd><nowiki>auto</nowiki></kbd>: set {{para|auto|1}}touse Wikidata to find sister links |
||
; <kbd><nowiki>search</nowiki></kbd>: override default search string (= title of page) |
|||
; <kbd><nowiki>display</nowiki></kbd>: set the display string on the sister links bar |
|||
; <kbd><nowiki>commonscat</nowiki></kbd>: link to Commons category instead of gallery |
|||
; <kbd><nowiki>author</nowiki></kbd>: link to Species author instead of taxon |
|||
'''Note''': positional arguments are interpreted as portals, will be appended after any named portal arguments. |
|||
== Examples == |
== Examples == |
||
Example |
Example: Simplest case. |
||
auto=1: Try this first to look up sister project links in Wikidata. |
|||
All set to "y". In order of use. Portal and spoken removed. Try this first. It will use the article name for all the sister links. Test them all, and adjust as necessary by adding other search terms. Quotes can be placed around search terms to require search results to include the complete phrase. |
|||
; Markup |
; Markup |
||
: <code><nowiki>{{Subject bar|auto=1}}</nowiki></code> |
|||
: <code><nowiki>{{Subject bar|commons = y|commons-search = |species = y|species-search = |voy = y|voy-search = |n = y|n-search = |wikt = y|wikt-search = |b = y|b-search = |q = y|q-search = |s = y|s-search = |v = y|v-search = |d = y|d-search = }}</nowiki></code> |
|||
; Result (if used on [[Lemur]]) |
|||
{{Subject bar|auto=1|qid=Q1192405}} |
|||
---- |
|||
Example page: [[Lemur]] |
Example page: [[Lemur]] |
||
; Markup |
; Markup |
||
: <code><nowiki>{{Subject bar|commons |
: <code><nowiki>{{Subject bar|commons= Category:Lemuriformes|species = Lemuriformes|portal1 = Primates|portal2 = Madagascar}}</nowiki></code> |
||
; Result |
; Result |
||
{{Subject bar|commons= |
{{Subject bar|commons= Category:Lemuriformes|species = Lemuriformes|portal1 = Primates|portal2 = Madagascar}} |
||
---- |
|||
Example page: [[Ring-tailed lemur]] |
Example page: [[Ring-tailed lemur]] |
||
; Markup |
; Markup |
||
: <code><nowiki>{{Subject bar|portal1 = Primates|portal2 = Madagascar|commons |
: <code><nowiki>{{Subject bar|portal1 = Primates|portal2 = Madagascar|commons = Category:Lemur catta |species = Lemur catta|n = Ring-tailed lemur|wikt = Lemur|b = Ring-tailed lemur|q = Ring-tailed lemur|s = Ring-tailed lemur|v = Ring-tailed lemur|voy = Madagascar}}</nowiki></code> |
||
; Result |
; Result |
||
{{Subject bar|portal1=Primates|portal2=Madagascar|commons= |
{{Subject bar|portal1 = Primates|portal2 = Madagascar|commons = Category:Lemur catta |species = Lemur catta|n = Ring-tailed lemur|wikt = Lemur|b = Ring-tailed lemur|q = Ring-tailed lemur|s = Ring-tailed lemur|v = Ring-tailed lemur|voy = Madagascar}} |
||
== Portal bar == |
== Portal bar == |
||
'''{{tl|Portal bar}}''' |
'''{{tl|Portal bar}}''' is a subset of {{tl|Subject bar}}, where only positional arguments are allowed. For example: |
||
; Markup |
|||
{{Portalbar |COVID-19|Medicine|Viruses}} |
|||
: <code><nowiki>{{Portal bar|COVID-19|Medicine|Viruses}}</nowiki></code> |
|||
; Result |
|||
{{Portal bar|COVID-19|Medicine|Viruses}} |
|||
== See also == |
== See also == |
||
Line 137: | Line 110: | ||
* {{tl|Portal bar}} |
* {{tl|Portal bar}} |
||
* {{tl|Sister project links}} |
* {{tl|Sister project links}} |
||
* {{tl|Sister bar}} |
|||
* {{tl|Cross-wiki user}} |
* {{tl|Cross-wiki user}} |
||
{{div col end}} |
{{div col end}} |
||
== TemplateData == |
|||
{{Collapse top|[[WP:TemplateData|TemplateData]] documentation used by [[WP:VisualEditor|VisualEditor]] and other tools}} |
|||
{{TemplateData header|noheader=1}} |
|||
<templatedata> |
|||
{ |
|||
"params": { |
|||
"portal1": { |
|||
"required": false, |
|||
"type": "string/line", |
|||
"aliases": ["1"], |
|||
"description": "The first portal, without surrounding text. For example, use \"Science\" to display the science portal." |
|||
}, |
|||
"portal2": { |
|||
"type": "string/line", |
|||
"aliases": ["2"], |
|||
"description": "The second portal." |
|||
}, |
|||
"portal3": { |
|||
"type": "string/line", |
|||
"aliases": ["3"], |
|||
"description": "The third portal." |
|||
}, |
|||
"portal4": { |
|||
"type": "string/line", |
|||
"aliases": ["4"], |
|||
"description": "The fourth portal" |
|||
}, |
|||
"portal5": { |
|||
"type": "string/line", |
|||
"aliases": ["5"], |
|||
"description": "The fifth portal." |
|||
}, |
|||
"auto": { |
|||
"label": "Use wikidata to fill sister link defaults", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "If auto=\"yes\", then sister projects with wikidata sitelinks are filled-in, others are off by default. Each project can be overridden with its own parameter." |
|||
}, |
|||
"display": { |
|||
"label": "Display name", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Use if the ''display name'' is different from the search term. For example, the bear article would be 'Bears'." |
|||
}, |
|||
"search": { |
|||
"label": "Search string", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "String to search in sister projects.", |
|||
"default": "Page title" |
|||
}, |
|||
"commonscat": { |
|||
"label": "Commons category", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Use if link to Commons category is desired instead of gallery." |
|||
}, |
|||
"author": { |
|||
"label": "Wikispecies author", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Use if link to Wikispecies author is desired instead of taxon." |
|||
}, |
|||
"wikt": { |
|||
"label": "Wiktionary link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wiktionary link to show. Acceptable values are a page name, \"yes\" (find page automatically) and \"no\".", |
|||
"aliases": ["wikt-search"], |
|||
"default": "No" |
|||
}, |
|||
"commons": { |
|||
"label": "Commons link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Commons link to show. Acceptable values are a page name, \"yes\" (find page automatically) and \"no\".", |
|||
"aliases": ["c", "c-search", "commons-search"], |
|||
"default": "No" |
|||
}, |
|||
"n": { |
|||
"label": "Wikinews link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikinews link to show. Acceptable values are a page name, \"yes\" (find page automatically) and \"no\".", |
|||
"aliases": ["n-search"], |
|||
"default": "No" |
|||
}, |
|||
"q": { |
|||
"label": "Wikiquote link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikiquote link to show. Acceptable values are a page name, \"yes\" (find page automatically) and \"no\".", |
|||
"aliases": ["q-search"], |
|||
"default": "No" |
|||
}, |
|||
"s": { |
|||
"label": "Wikisource link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikisource link to show. Acceptable values are a page name, \"yes\" (find page automatically) and \"no\".", |
|||
"aliases": ["s-search"], |
|||
"default": "No" |
|||
}, |
|||
"b": { |
|||
"label": "Wikibooks link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikibooks link to show. Acceptable values are a page name, \"yes\" (find page automatically) and \"no\".", |
|||
"aliases": ["b-search"], |
|||
"default": "No" |
|||
}, |
|||
"voy": { |
|||
"label": "Wikivoyage link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikivoyage link to show. Acceptable values are a page name, \"yes\" (find page automatically), and \"no\".", |
|||
"aliases": ["voy-search"], |
|||
"default": "No" |
|||
}, |
|||
"v": { |
|||
"label": "Wikiversity link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikiversity link to show. Acceptable values are a page name, \"yes\", (find page automatically) and \"no\".", |
|||
"aliases": ["v-search"], |
|||
"default": "No" |
|||
}, |
|||
"d": { |
|||
"label": "Wikidata link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikidata link to show. Acceptable values are a QID, \"yes\" (find page automatically), and \"no\".", |
|||
"aliases": ["d-search"], |
|||
"default": "No" |
|||
}, |
|||
"species": { |
|||
"label": "Wikispecies taxon link", |
|||
"type": "string", |
|||
"required": false, |
|||
"description": "Wikispecies link to show. Acceptable values are a page name, \"yes\" (find page automatically), and \"no\". The default is \"No\".", |
|||
"aliases": ["species-search"], |
|||
"default": "No" |
|||
} |
|||
}, |
|||
"description": "This template adds a bar of portals and sister links. It is usually used just above an article's navboxes." |
|||
} |
|||
</templatedata> |
|||
{{Collapse bottom}} |
|||
<includeonly>{{Sandbox other|| |
<includeonly>{{Sandbox other|| |
||
[[Category:Wikipedia Portal navflags|{{PAGENAME}}]] |
[[Category:Wikipedia Portal navflags|{{PAGENAME}}]] |
||
[[Category:Interwiki link templates|{{PAGENAME}}]] |
[[Category:Interwiki link templates|{{PAGENAME}}]] |
||
[[Category:Exclude in print]] |
|||
}}</includeonly> |
}}</includeonly> |
![]() | This is a documentation subpage for Template:Subject bar. It may contain usage information, categories and other content that is not part of the original template page. |
![]() | This template is used on approximately 18,000 pages and changes may be widely noticed. Test changes in the template's /sandboxor/testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
![]() | This template uses Lua:
|
This navigational template offers a variant to several floating box templates that link to portals, and Wikipedia's sister projects but also typically cause formatting issues because of their size and alignment.
It is intended to be placed at the end of an article, after the references, external links, navboxes and before any authority control template or categories.
No single parameter is required, however, at least one portal or sister project should be utilized with the use of this template. Since Wikipedia articles typically are in the domain of one or more WikiProjects, and since WikiProjects often have a portal, almost every article should list at least one portal. None of the parameters should be capitalized.
When copying all parameters in either the vertical or horizontal layouts, delete those which are not needed. If no links are needed for a particular type, such as the historical "books", that part of the template will not appear on the page.
Parameter meanings (quick list). Alphabetical order: b: Wikibooks. commons: WikiMedia Commons. d: Wikidata. n: Wikinews. q: Wikiquote. s: Wikisource. species: Wikispecies. v: Wikiversity. voy: Wikivoyage. wikt: Wiktionary.
{{Subject bar|commons = y|species = y|voy = y|n = y|wikt = y|b = y|q = y|s = y|v = y|d = y|portal = }}
portal
which is often removed.{{Subject bar|b = |commons = |d = |n = |q = |s = |species = |v = |voy = |wikt = |portal = }}
portal
which is often removed.{{Subject bar
|b=
|commons =
|d=
|n=
|q=
|s=
|species =
|v=
|voy =
|wikt =
|portal =
}}
portal###
where ### is any number to link to a portal|auto=1
to use Wikidata to find sister linksNote: positional arguments are interpreted as portals, will be appended after any named portal arguments.
Example: Simplest case.
auto=1: Try this first to look up sister project links in Wikidata.
{{Subject bar|auto=1}}
Example page: Lemur
{{Subject bar|commons= Category:Lemuriformes|species = Lemuriformes|portal1 = Primates|portal2 = Madagascar}}
Example page: Ring-tailed lemur
{{Subject bar|portal1 = Primates|portal2 = Madagascar|commons = Category:Lemur catta |species = Lemur catta|n = Ring-tailed lemur|wikt = Lemur|b = Ring-tailed lemur|q = Ring-tailed lemur|s = Ring-tailed lemur|v = Ring-tailed lemur|voy = Madagascar}}
{{Portal bar}} is a subset of {{Subject bar}}, where only positional arguments are allowed. For example:
{{Portal bar|COVID-19|Medicine|Viruses}}
TemplateData documentation used by VisualEditor and other tools | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
See a monthly parameter usage report for Template:Subject bar in articles based on its TemplateData.
TemplateData for Subject bar This template adds a bar of portals and sister links. It is usually used just above an article's navboxes.
|