Template:Forum link: Difference between revisions
(Added an example showing the failure of the 'hilit' parameter when 'p' is supplied.) |
(Added support for a 'u' parameter for specifying a forum user number. This still needs to be implemented in {{forum url}}.) |
||
Line 8: | Line 8: | ||
-->| {{#if: {{{title|{{{text|}}}}}} | -->| {{#if: {{{title|{{{text|}}}}}} | ||
| {{#if: {{{title|}}} | | {{#if: {{{title|}}} | ||
| {{#if: {{{ | | {{#if: {{{u|}}} | ||
| {{LangSwitch | | {{LangSwitch | ||
| de = '{{{title}}}' | | de = Der FlightGear-Forum Benutzer '{{{title}}}'. | ||
| en = '{{{title}}}' | | en = The FlightGear forum user '{{{title}}}'. | ||
}} | }} | ||
| {{#if: {{{ | | {{#if: {{{p|}}} | ||
| {{LangSwitch | | {{LangSwitch | ||
| de = '{{{title}}}' | | de = '{{{title}}}' Post im FlightGear-Forum. | ||
| en = '{{{title}}}' | | en = '{{{title}}}' post on the FlightGear forum. | ||
}} | }} | ||
| {{LangSwitch | | {{#if: {{{t|}}} | ||
| de = '{{{title}}}' Unterforum des FlightGear-Forums. | | {{LangSwitch | ||
| de = '{{{title}}}' Thema des FlightGear-Forums. | |||
| en = '{{{title}}}' topic on the FlightGear forum. | |||
}} | |||
| {{LangSwitch | |||
| de = '{{{title}}}' Unterforum des FlightGear-Forums. | |||
| en = '{{{title}}}' subforum of the FlightGear forum. | |||
}} | |||
}} | }} | ||
}} | }} | ||
Line 35: | Line 41: | ||
| t{{#if:{{{t|}}}||NULL}} = {{{t}}} | | t{{#if:{{{t|}}}||NULL}} = {{{t}}} | ||
| p{{#if:{{{p|}}}||NULL}} = {{{p}}} | | p{{#if:{{{p|}}}||NULL}} = {{{p}}} | ||
| u{{#if:{{{u|}}}||NULL}} = {{{u}}} | |||
| anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}} | | anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}} | ||
| hilit{{#if:{{{hilit|}}}||NULL}} = {{{hilit}}} | | hilit{{#if:{{{hilit|}}}||NULL}} = {{{hilit}}} | ||
Line 43: | Line 50: | ||
| t{{#if:{{{t|}}}||NULL}} = {{{t}}} | | t{{#if:{{{t|}}}||NULL}} = {{{t}}} | ||
| p{{#if:{{{p|}}}||NULL}} = {{{p}}} | | p{{#if:{{{p|}}}||NULL}} = {{{p}}} | ||
| u{{#if:{{{u|}}}||NULL}} = {{{u}}} | |||
| anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}} | | anchor{{#if:{{{anchor|}}}||NULL}} = {{{anchor}}} | ||
| hilit{{#if:{{{hilit|}}}||NULL}} = {{{hilit}}} | | hilit{{#if:{{{hilit|}}}||NULL}} = {{{hilit}}} | ||
Line 48: | Line 56: | ||
-->{{#if: {{{title|{{{text|}}}}}} | -->{{#if: {{{title|{{{text|}}}}}} | ||
| {{#if: {{{title|}}} | | {{#if: {{{title|}}} | ||
| {{#if: {{{ | | {{#if: {{{u|}}} | ||
| {{LangSwitch | | {{LangSwitch | ||
| de = ''{{{title}}}'' | | de = der Forum Benutzer ''{{{title}}}'' | ||
| en = ''{{{title}}}'' | | en = the forum user ''{{{title}}}'' | ||
}} | }} | ||
| {{#if: {{{ | | {{#if: {{{p|}}} | ||
| {{LangSwitch | | {{LangSwitch | ||
| de = ''{{{title}}}'' | | de = ''{{{title}}}'' Post im Forum | ||
| en = ''{{{title}}}'' | | en = ''{{{title}}}'' post on the forum | ||
}} | }} | ||
| {{LangSwitch | | {{#if: {{{t|}}} | ||
| de = ''{{{title}}}'' Unterforum | | {{LangSwitch | ||
| de = ''{{{title}}}'' Thema des Forums | |||
| en = ''{{{title}}}'' topic on the forum | |||
}} | |||
| {{LangSwitch | |||
| de = ''{{{title}}}'' Unterforum | |||
| en = ''{{{title}}}'' subforum | |||
}} | |||
}} | }} | ||
}} | }} | ||
Line 96: | Line 110: | ||
{{!}} ''t'' = | {{!}} ''t'' = | ||
{{!}} ''p'' = | {{!}} ''p'' = | ||
{{!}} ''u'' = | |||
{{!}} ''anchor'' = | {{!}} ''anchor'' = | ||
{{!}} ''hilit'' = | {{!}} ''hilit'' = | ||
Line 112: | Line 127: | ||
; p: Post number to be passed to phpBB's viewtopic.php (optional). | ; p: Post number to be passed to phpBB's viewtopic.php (optional). | ||
; u: User number to be passed to phpBB's memberlist.php (optional). If supplied, the {{param|f}}, {{param|t}}, {{param|p}}, {{param|anchor}}, and {{param|hilit}} parameters will be ignored. | |||
; anchor: HTML anchor, used for jumping to posts (optional). | ; anchor: HTML anchor, used for jumping to posts (optional). | ||
Line 298: | Line 315: | ||
{{forum link|title=Re: Marking topics as "solved"|p=111333|hilit=contains+a+problem}} | {{forum link|title=Re: Marking topics as "solved"|p=111333|hilit=contains+a+problem}} | ||
=== User === | |||
{{obr}}forum link{{!}}u=2{{cbr}} | |||
{{forum link|u=2}} | |||
{{obr}}forum link{{!}}title=curt{{!}}u=2{{cbr}} | |||
{{forum link|title=curt|u=2}} | |||
{{obr}}forum link{{!}}text=curt{{!}}u=2{{cbr}} | |||
{{forum link|text=curt|u=2}} | |||
{{obr}}forum link{{!}}title=curt{{!}}u=2{{!}}noicon=yes{{cbr}} | |||
{{forum link|title=curt|u=2|noicon=yes}} | |||
{{obr}}forum link{{!}}title=curt{{!}}u=2{{!}}onlyicon=yes{{cbr}} | |||
{{forum link|title=curt|u=2|onlyicon=yes}} | |||
=== Different icon sizes === | === Different icon sizes === |
Revision as of 15:04, 6 June 2019
Goal
This template is used to create MediaWiki links - either via text or the icon - to subforums, topics and posts on the FlightGear forum.
Usage
{{forum link | title = | text = | f = | t = | p = | u = | anchor = | hilit = | noicon = | onlyicon = | size = }}
- title
- Topic title (optional). This will be italicised and used to build the link text.
- text
- The link text (optional). This is an alternative to the title parameter and, if supplied, will be used for the link text.
- f
- Forum number to be passed to phpBB's viewtopic.php (optional).
- t
- Thread number to be passed to phpBB's viewtopic.php (optional).
- p
- Post number to be passed to phpBB's viewtopic.php (optional).
- u
- User number to be passed to phpBB's memberlist.php (optional). If supplied, the f, t, p, anchor, and hilit parameters will be ignored.
- anchor
- HTML anchor, used for jumping to posts (optional).
- hilit
- Words on the forum posts to be highlighted (optional). Words should be separated by the plus character "+".
- size
- The icon size (optional). This should be a valid MediaWiki image size value, e.g. 32px.
Technical details
This template uses the {{forum url}} template to construct the URI part of the link. That template then uses the {{project infrastructure}} template to provide the protocol and domain name part of the URI.
Examples
No arguments
{{forum link}}
A subforum (The FlightGear project)
{{forum link|f=42}}
{{forum link|title=The FlightGear project|f=42}}
The FlightGear project subforum
{{forum link|text=The FlightGear project|f=42}}
{{forum link|title=The FlightGear project|f=42|noicon=yes}}
The FlightGear project subforum
{{forum link|title=The FlightGear project|f=42|onlyicon=yes}}
A topic (FlightGear Newsletter)
{{forum link|t=7794}}
{{forum link|title=FlightGear Newsletter|t=7794}}
FlightGear Newsletter topic on the forum
{{forum link|text=FlightGear Newsletter|t=7794}}
{{forum link|title=FlightGear Newsletter|t=7794|noicon=yes}}
FlightGear Newsletter topic on the forum
{{forum link|title=FlightGear Newsletter|t=7794|onlyicon=yes}}
A post (Re: Marking topics as "solved")
{{forum link|p=111333}}
{{forum link|title=Re: Marking topics as "solved"|p=111333}}
Re: Marking topics as "solved" post on the forum
{{forum link|text=Re: Marking topics as "solved"|p=111333}}
Re: Marking topics as "solved"
{{forum link|title=Re: Marking topics as "solved"|p=111333|noicon=yes}}
Re: Marking topics as "solved" post on the forum
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes}}
Subforum, topic and post
Note The f and t parameters are redundant in this URL. |
{{forum link|f=8|t=10805|p=111333}}
{{forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333}}
Re: Marking topics as "solved" post on the forum
{{forum link|text=Re: Marking topics as "solved"|f=8|t=10805|p=111333}}
Re: Marking topics as "solved"
{{forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333|noicon=yes}}
Re: Marking topics as "solved" post on the forum
{{forum link|title=Re: Marking topics as "solved"|f=8|t=10805|p=111333|onlyicon=yes}}
Topic and post
Note The t parameter is redundant in this URL. |
{{forum link|t=10805|p=111333}}
{{forum link|title=Re: Marking topics as "solved"|t=10805|p=111333}}
Re: Marking topics as "solved" post on the forum
{{forum link|text=Re: Marking topics as "solved"|t=10805|p=111333}}
Re: Marking topics as "solved"
{{forum link|title=Re: Marking topics as "solved"|t=10805|p=111333|noicon=yes}}
Re: Marking topics as "solved" post on the forum
{{forum link|title=Re: Marking topics as "solved"|t=10805|p=111333|onlyicon=yes}}
Anchoring
{{forum link|t=10805|anchor=p111333}}
{{forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333}}
Re: Marking topics as "solved" topic on the forum
{{forum link|text=Re: Marking topics as "solved"|t=10805|anchor=p111333}}
Re: Marking topics as "solved"
{{forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333|noicon=yes}}
Re: Marking topics as "solved" topic on the forum
{{forum link|title=Re: Marking topics as "solved"|t=10805|anchor=p111333|onlyicon=yes}}
Highlighting
{{forum link|t=10805|hilit=board+index}}
{{forum link|title=board index|t=10805|hilit=board+index}}
board index topic on the forum
{{forum link|text=board index|t=10805|hilit=board+index}}
{{forum link|title=board index|t=10805|hilit=board+index|noicon=yes}}
board index topic on the forum
{{forum link|title=board index|t=10805|hilit=board+index|onlyicon=yes}}
Highlight a post
{{forum link|title=Re: Marking topics as "solved"|p=111333|hilit=contains+a+problem}}
Re: Marking topics as "solved" post on the forum
User
{{forum link|u=2}}
{{forum link|title=curt|u=2}}
{{forum link|text=curt|u=2}}
{{forum link|title=curt|u=2|noicon=yes}}
{{forum link|title=curt|u=2|onlyicon=yes}}
Different icon sizes
Text and icon
{{forum link|title=Re: Marking topics as "solved"|p=111333|size=15px}}
Re: Marking topics as "solved" post on the forum
{{forum link|title=Re: Marking topics as "solved"|p=111333|size=32px}}
Re: Marking topics as "solved" post on the forum
{{forum link|title=Re: Marking topics as "solved"|p=111333|size=64px}}
Re: Marking topics as "solved" post on the forum
{{forum link|title=Re: Marking topics as "solved"|p=111333|size=200px}}
Re: Marking topics as "solved" post on the forum
Icon only
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes|size=15px}}
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes|size=32px}}
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes|size=64px}}
{{forum link|title=Re: Marking topics as "solved"|p=111333|onlyicon=yes|size=200px}}
Related templates
- {{forum}}
- {{project infrastructure}}
- {{forum url}}