Difference between revisions of "Template:Button"

From EUSwiki
Jump to: navigation, search
 
(13 intermediate revisions by the same user not shown)
Line 56: Line 56:
 
{{Button|1=http://mcgilleus.ca|2=Right Icon|3=fas fa-fast-forward|4=#3F7CAC|9=iright}}
 
{{Button|1=http://mcgilleus.ca|2=Right Icon|3=fas fa-fast-forward|4=#3F7CAC|9=iright}}
 
</noinclude>
 
</noinclude>
<includeonly><div class="no-link" style="
+
<includeonly><div class="no-link" id="butt" style="
 
display: inline-block;
 
display: inline-block;
 
text-decoration:none;  
 
text-decoration:none;  
margin: 0px 8px;
+
margin: 0px 8px 5px 8px;
 +
border-radius:inherit;
 
background-color: {{{4}}};  
 
background-color: {{{4}}};  
 
border: none;
 
border: none;
Line 66: Line 67:
 
text-decoration: none;
 
text-decoration: none;
 
font-size: {{#ifeq: {{{8|}}}|small|14px|16px}};
 
font-size: {{#ifeq: {{{8|}}}|small|14px|16px}};
{{#if:{{{7|}}}|{{#ifeq:{{{7|}}}|right|float:right;|float:left;}}|}}">
+
{{#if:{{{7|}}}|{{#ifeq:{{{7|}}}|right|float:right;|float:left;}}|}};{{{extra|}}}">
 
{{#ifeq:{{{5|}}}|internal
 
{{#ifeq:{{{5|}}}|internal
|[[{{{1}}}|{{#ifeq:{{{9|}}}|iright|<span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}">{{{2}}}&emsp;<i class="{{{3}}}"></i></span>|<span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}"><i class="{{{3}}}"></i>&emsp;{{{2}}}</span>}}]]
+
|[[{{{1}}}|{{#ifeq:{{{9|}}}|iright|<span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}">{{#if:{{{2|}}}|{{{2}}}&emsp;}}<i class="{{{3}}}"></i></span>|<span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}"><i class="{{{3}}}"></i>{{#if:{{{2|}}}|&emsp;{{{2}}}|}}</span>}}]]
|{{#ifeq:{{{9|}}}|iright|[{{{1}}} <span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}">{{{2}}}&emsp;<i class="{{{3}}}"></i></span>]|[{{{1}}} <span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}"><i class="{{{3}}}"></i>&emsp;{{{2}}}</span>]}}}} </div></includeonly>
+
|{{#ifeq:{{{9|}}}|iright|[{{{1}}} <span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}">{{#if:{{{2|}}}|{{{2}}}&emsp;|}}<i class="{{{3}}}"></i></span>]|[{{{1}}} <span style="color:{{#if:{{{6|}}}|{{{6}}}|#fff}}"><i title="{{{10|}}}" class="{{{3}}}"></i>{{#if:{{{2|}}}|&emsp;{{{2}}}}}</span>]}}}} </div></includeonly>

Latest revision as of 15:08, 6 December 2019


This button is versatile! It can be used most any which ways you need it to, but the default is really straight forward. You start by calling the button like {{Button}}, then piping each attribute afterwards, |1=link, |2=text, and so on. You must call the first four arguments, the rest are for extra control.
Default button
{{Button|1=http://directory.mcgilleus.ca|2=Default button appearance|3=fas fa-folder|4=#C3423F}}

Default attributes are: Internal link, large button, float left, white text.
Additional attributes can be added at will, as many or few in any order you'd like.

Attributes

Options 1 - 4 are necessary, 5-9 offer options

1 = Page title or Link (Link requires #5)
2 = Button text
3 = FontAwesome Icon
4 = Button Color
---
5 = internal/external (optional, external default)
6 = text color (optional, white default)
7 = Float Button position, left or right (optional, no float by default)
8 = Button size, small or large (optional, large default)
9 = Icon placement, ileft or iright (optional, default ileft)

5 Type of link

6 Text Color

If you'd like to change the link color, using either words, hex, or rgba(), set 6=color of choice.
{{Button|...|6=Crimson}}

Default the text is white, 6= is not necessary for this case.

7 Button position

If you want the button to float to the right of the page, use 7=right.
{{Button|...|7=right}}

Additionally, if you want it to float=left (meaning that all other objects, headers included, will stay to the right of the block), you can specity 7=left.

8 Button size

You can make the button teeny, 8=small.
{{Button|...|8=small}}

9 Icon placement

The icon can be on the right side as well.
{{Button|...|9=iright}}