User:Bugman/forum url: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Initial copy of {{[[Template:forumref|forumref}} from http://wiki.flightgear.org/index.php?title=Template:Forumref&oldid=118461.)
 
(Complete redesign of the template.)
Line 1: Line 1:
<span class="plainlinks">[https://forum.flightgear.org/viewtopic.php?<!--
{{project infrastructure|forum|link=no}}<!--
-->{{#if:{{{f|}}}|f={{{f}}}<!-- Add an ampersand if t, p or hilit are present afterwards
  -->{{#if: {{{f|{{{t|{{{p|{{{anchor|{{{hilit|}}}}}}}}}}}}}}} | viewtopic.php?}}<!-- Add viewtopic.php if any arguments are supplied.
-->{{#if:{{{t|}}}|&|{{#if:{{{p|}}}|&|{{#if:{{{hilit|}}}|&|}}}}}}<!--
  -->{{#if: {{{f|}}}
-->|}}{{#if:{{{t|}}}|t={{{t}}}<!-- Add an ampersand if p or hilit are present afterwards
      | f={{{f}}}<!--
-->{{#if:{{{p|}}}|&|{{#if:{{{hilit|}}}|&|}}}}<!--
      -->{{#if: {{{t|{{{p|{{{hilit|}}}}}}}}} | &}}<!-- Add an ampersand if t, p or hilit are present afterwards. -->
-->|}}{{#if:{{{p|}}}|p={{{p}}}#p{{{p}}}<!-- Add an ampersand if hilit is present afterwards
    }}<!--
-->{{#if:{{{hilit|}}}|&|}}<!--
  -->{{#if: {{{t|}}}
-->|}}{{#if:{{{hilit|}}}|hilit={{{hilit}}}|}}{{#if:{{{label|}}}|&#35;{{{label}}}|}} {{#if:{{{title|}}}|''{{{title}}}'' on the forum|Forum link}}]</span>{{#if: {{{noicon|}}} | | &#32;[[File:FlightGear icon 15px.png|This is a link to the FlightGear forum|link=Template:Forumref]] }}<noinclude>
      | t={{{t}}}<!--
      -->{{#if: {{{p|{{{hilit|}}}}}} | &}}<!-- Add an ampersand if p or hilit are present afterwards -->
    }}<!--
  -->{{#if: {{{p|}}}
      | p={{{p}}}#p{{{p}}}<!--
      -->{{#if: {{{hilit|}}} | &}}<!-- Add an ampersand if hilit is present afterwards -->
    }}<!--
  -->{{#if: {{{hilit|}}}
      | hilit={{{hilit}}}
    }}<!--
  -->{{#if: {{{anchor|}}}
      | &#35;{{{anchor}}}
    }}<noinclude>
{{Informative template|1=
{{Informative template|1=
__NOTOC__
__NOTOC__
== Goal ==
== Goal ==
This template can be used when linking to topics and posts on the FlightGear forum.
This template is used to create URLs for subforums, topics or posts on the FlightGear forum.  The URL part of the URI is built using the {{tl|project infrastructure}} template.


== Usage ==
== Usage ==
{{obr}}'''forumref'''{{!}}title={{!}}''t=''{{!}}''p=''{{!}}''label=''{{!}}''hilit=''{{!}}''f=''{{!}}''noicon=''{{cbr}}


; title: Topic title
{{obr}}'''forum url'''
{{!}} ''f''      =
{{!}} ''t''      =
{{!}} ''p''      =
{{!}} ''anchor'' =
{{!}} ''hilit''  =
{{cbr}}


; t: Thread number to be passed to phpBB's viewtopic.php (optional)
; f: Forum number to be passed to phpBB's viewtopic.php (optional).


; p: Post number to be passed to phpBB's viewtopic.php (optional)
; t: Thread number to be passed to phpBB's viewtopic.php (optional).


; label: HTML label, used for jumping to posts (optional)
; p: Post number to be passed to phpBB's viewtopic.php (optional).


; hilit: Words on the forum posts to be highlighted (optional)
; anchor: HTML anchor, used for jumping to posts (optional).


; f: Forum number to be passed to phpBB's viewtopic.php (optional)
; hilit: Words on the forum posts to be highlighted (optional).  Words should be separated by the plus character "+".


; noicon: If true, the little FlightGear icon ([[File:FlightGear icon 15px.png]]) will not be shown.
== Examples ==


== Example ==
=== No arguments ===
Linking to a subtopic
<nowiki>{{forumref|title=FlightGear Newsletter|t=7794}}</nowiki>


{{forumref|title=FlightGear Newsletter|t=7794}}
{{obr}}User:Bugman/forum url{{cbr}}


{{User:Bugman/forum url}}


Linking to a post
=== A subforum (The FlightGear project) ===
<nowiki>{{forumref|title=Re: Marking topics as "solved"|p=111333}}</nowiki>


{{forumref|title=Re: Marking topics as "solved"|p=111333}}
{{obr}}User:Bugman/forum url{{!}}f=42{{cbr}}
 
{{User:Bugman/forum url|f=42}}
 
=== A topic (FlightGear Newsletter) ===
 
{{obr}}User:Bugman/forum url{{!}}t=7794{{cbr}}
 
{{User:Bugman/forum url|t=7794}}
 
=== A post (Re: Marking topics as "solved") ===
 
{{obr}}User:Bugman/forum url{{!}}p=111333{{cbr}}
 
{{User:Bugman/forum url|p=111333}}
 
=== Anchoring ===
 
{{obr}}User:Bugman/forum url{{!}}t=10805{{!}}anchor=p111333{{cbr}}
 
{{User:Bugman/forum url|t=10805|anchor=p111333}}
 
=== Highlighting ===
 
{{obr}}User:Bugman/forum url{{!}}t=10805{{!}}hilit=board+index{{cbr}}
 
{{User:Bugman/forum url|t=10805|hilit=board+index}}
 
== Related templates ==


== Related template ==
* {{tl|forum}}
* {{tl|forum}}
* {{tl|project infrastructure}}
* [[User:Bugman/forum ref]]


}}
}}

Revision as of 13:08, 2 June 2019

https://forum.flightgear.org

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. The URL part of the URI is built using the {{project infrastructure}} template.

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 "+".

Examples

No arguments

{{User:Bugman/forum url}}

https://forum.flightgear.org

A subforum (The FlightGear project)

{{User:Bugman/forum url|f=42}}

https://forum.flightgear.orgviewtopic.php?f=42

A topic (FlightGear Newsletter)

{{User:Bugman/forum url|t=7794}}

https://forum.flightgear.orgviewtopic.php?t=7794

A post (Re: Marking topics as "solved")

{{User:Bugman/forum url|p=111333}}

https://forum.flightgear.orgviewtopic.php?p=111333#p111333

Anchoring

{{User:Bugman/forum url|t=10805|anchor=p111333}}

https://forum.flightgear.orgviewtopic.php?t=10805#p111333

Highlighting

{{User:Bugman/forum url|t=10805|hilit=board+index}}

https://forum.flightgear.orgviewtopic.php?t=10805&hilit=board+index

Related templates