Template:Forum url: Difference between revisions
Jump to navigation
Jump to search
(Added an example showing the failure of the 'hilit' parameter when 'p' is supplied.) |
(Anchoring fix - the post anchoring is now at the very end of the URI, and only if 'p' has been supplied and 'anchor' has not.) |
||
Line 15: | Line 15: | ||
}}<!-- | }}<!-- | ||
-->{{#if: {{{p|}}} | -->{{#if: {{{p|}}} | ||
| p= | | p={{{p}}}<!-- | ||
-->{{#if: {{{hilit|}}} | &}}<!-- Add an ampersand if hilit is present afterwards --> | -->{{#if: {{{hilit|}}} | &}}<!-- Add an ampersand if hilit is present afterwards --> | ||
}}<!-- | }}<!-- | ||
Line 21: | Line 21: | ||
| hilit={{{hilit}}} | | hilit={{{hilit}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if: {{{anchor|}}} | -->{{#if: {{{anchor|{{{p|}}}}}}<!-- Post anchoring --> | ||
| #{{{anchor}}} | | #{{#if: {{{anchor|}}} | ||
| {{{anchor}}} | |||
| p{{{p}}} | |||
}} | |||
}}<noinclude> | }}<noinclude> | ||
{{Informative template|1= | {{Informative template|1= |
Revision as of 09:47, 6 June 2019
The following template description is not displayed when the template is inserted in an article.
Goal
This template is used to create URLs for subforums, topics or posts on the FlightGear forum.
Usage
{{forum url | f = | t = | p = | anchor = | hilit = }}
- 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).
- 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 "+".
Technical details
The protocol and domain name part of the URI is built using the {{project infrastructure}} template.
Examples
No arguments
{{forum url}}
A subforum (The FlightGear project)
{{forum url|f=42}}
https://forum.flightgear.org/viewforum.php?f=42
A topic (FlightGear Newsletter)
{{forum url|t=7794}}
https://forum.flightgear.org/viewtopic.php?t=7794
A post (Re: Marking topics as "solved")
{{forum url|p=111333}}
https://forum.flightgear.org/viewtopic.php?p=111333#p111333
Subforum, topic and post
Note The f and t parameters are redundant in this URL. |
{{forum url|f=8|t=10805|p=111333}}
https://forum.flightgear.org/viewtopic.php?f=8&t=10805&p=111333#p111333
Topic and post
Note The t parameter is redundant in this URL. |
{{forum url|t=10805|p=111333}}
https://forum.flightgear.org/viewtopic.php?t=10805&p=111333#p111333
Anchoring
{{forum url|t=10805|anchor=p111333}}
https://forum.flightgear.org/viewtopic.php?t=10805#p111333
Highlighting
{{forum url|t=10805|hilit=board+index}}
https://forum.flightgear.org/viewtopic.php?t=10805&hilit=board+index
Highlight a post
{{forum url|p=111333|hilit=contains+a+problem}}
https://forum.flightgear.org/viewtopic.php?p=111333&hilit=contains+a+problem#p111333
Related templates
- {{forum}}
- {{project infrastructure}}
- {{forum link}}