Difference between revisions of "Template:FP link"

From Stoneshard wiki
Jump to navigation Jump to search
old>TheSatanicSanta
m
old>TheSatanicSanta
m
Line 1: Line 1:
<onlyinclude><includeonly><div class="fplink plainlinks {{#if:{{{image|}}}|image|}} {{#switch:{{lc:{{{size|}}} }}|wide={{lc:{{{size|}}} }} }}"><div class="box"><div class="row"><div class="cell">{{#if:{{{image|}}}
<onlyinclude><includeonly><div class="fplink-outer plainlinks {{#switch:{{lc:{{{width|}}}}}|wide=fplink-wide|full=fplink-fullwidth}}">
  |<div class="image">{{#if:{{{url|}}}
<div class="fplink {{#switch:{{{plain|}}}|yes|true|1=fplink-plain}}">
    |
{{#if:{{{image|}}}|<div class="fplink-inner {{#ifexist:Media:{{{image|}}}||nomobile}}">{{#ifexist:Media:{{{image|}}}
    |{{#ifexist:Media:{{{image|}}}|[[File:{{{image|}}}|link={{{1|}}}]]|<span class="nomobile">[[File:{{{image|}}}|Please upload 150x150 image]]</span>}}
|[[File:{{{image|}}}|150x150px|link={{#if:{{{url|}}}
  }}</div>
|{{{url|}}}
|}}<div class="link">{{#if:{{{url|}}}
|{{{1|}}}
  |{{#if:{{{1|}}}|[{{{url}}} {{{1}}}]|[{{{url}}}]}}
}}]]
  |{{#if:{{{1|}}}|{{#if:{{{2|}}}|[[{{{1}}}|{{{2}}}]]|[[{{{1}}}]]|}}}}
|[[File:{{{image|}}}|Please upload an image]]
}}</div></div></div></div></div></includeonly></onlyinclude>{{doc}}
}}
</div>
}}{{#switch:{{#if:{{{image|}}}|{{{imageonly|}}}|}}
|yes|true|1=
|#default=<div class="fplink-inner">{{#if:{{{url|}}}
|{{#if:{{{1|}}}
|[{{{url}}} {{{1}}}]
|[{{{url}}}]
}}
|{{#if:{{{1|}}}
|{{#if:{{{2|}}}
|[[{{{1}}}|{{{2}}}]]
|[[{{{1}}}]]
}}
}}
}}
</div>
}}
</div>
</div></includeonly></onlyinclude><noinclude>
{{doc}}
[[Category:Formatting templates]]
[[Category:Formatting templates]]
</noinclude>

Revision as of 00:21, 5 May 2020

Template-info.png Documentation

This template is for creating the styled links used within boxes on the front page: Stoneshard wiki. It relies heavily on CSS in MediaWiki:Common.css, MediaWiki:Hydra.css / MediaWiki:Hydradark.css and MediaWiki:Mobile.css.

Usage

Any group of {{FP link}} templates must be enclosed by an element with the class fplinks.

Internal (wiki) links

{{FP link | destination | display text /optional
| image = file link /optional
| width = <normal/wide/full> /optional
| imageonly = <true/false> /optional
| plain = <true/false> /optional
}}

External links

{{FP link | url = destination | display text /optional
| image = file link /optional
| width = <normal/wide/full> /optional
| imageonly = <true/false> /optional
| plain = <true/false> /optional
}}

Parameters

Internal (wiki) links

destination
Destination wiki page. Required.
display text
Optional text to display instead of the name of the destination page.

External links

|url=
The destination URL. Required for external links.
display text
Optional text to display instead of the URL. If omitted, the full URL will be displayed.

Style parameters

|image=
Optional image, to be displayed above the link.
|width=
Determines the size of the link box. normal links take up to 25% of the width of the containing element. wide links take up to 33% of the containing element. full links take the entire width of the containing element. If omitted, defaults to normal.
|imageonly=
When an image is specified, this determines whether to show only the image or both the image and the link. true will show only the image, false will show the link as well. If omitted, defaults to false.
|plain=
This provides an option to remove backgrounds and borders for certain links. true will remove visible styles, false will use the default styles. If omitted, defaults to false.

Examples

Links only

<div class="fplinks">
{{FP link | Main Page | Normal}}
{{FP link | Main Page | Wide | width = wide}}
{{FP link | Main Page | Plain | plain = true}}

{{FP link | Main Page | Full width | width = full}}
</div>

With images

<div class="fplinks">
{{FP link | Main Page | With image | image = Wiki.png}}
{{FP link | Main Page | Hidden text | image = Wiki.png | imageonly = true}}
{{FP link | Main Page | Plain | image = Wiki.png | plain = true}}
{{FP link | Main Page | Plain | image = Wiki.png | plain = true | imageonly = true}}

{{FP link | Main Page | Wide with image | image = Wiki.png | width = wide}}
{{FP link | Main Page | Wide hidden text | image = Wiki.png | width = wide | imageonly = true}}
</div>