Template:Quote fancy: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Added image position parameter)
mNo edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<!-- Import template-specific CSS -->
<!-- Import template-specific CSS -->
<templatestyles src="ImageQuote/style.css" />
<templatestyles src="Quote fancy/style.css" />
<div style="justify-content:{{{align|left}}}; flex-direction:{{#ifeq:{{{image-position|}}}|right|row-reverse|row}}" class="bg3wiki-image-quote">
<!-- The template uses a 3x3 grid layout with the quote and author attribution fixed in the
    center and center bottom positions respectively. Depending on the image-position param
    and whether the user is on mobile, the image will be placed in the west, east, or north
    positions. -->
<div
  class="bg3wiki-fancy-quote"
  style="justify-content:{{#ifeq:{{{image-align|center}}}|edge|space-between|center}}"
>
<!-- Quote image -->
<!-- Quote image -->
{{#if:{{{image|}}}|[[File:{{{image|}}}|x{{{height|80px}}}|link={{{link|}}}|class=bg3wiki-image-quote-image]]}}
{{#if:{{{image|}}}| {{Image frame
<!-- Container for the quote and the author/attribution if present -->
| image = {{{image|}}}
<div style="display: flex; flex-direction: column;">
| link = {{#ifeq: {{{link|}}}|{{PAGENAME}}||{{{link|}}}}}
  <!-- Formatted quote -->
| height = {{{height|80}}}
  <blockquote class="bg3wiki-image-quote-blockquote-{{{image-position|left}}}" style="font-size:{{{font-size|130%}}}">
| border-shape = {{{image-border-shape|rounded}}}
    <div style="display:flex;align-items:center>
| border-width = {{{image-border-width|0}}}
      <!-- Starting quotation mark. Aligned with the top-left corner of the quote text -->
| border-color = {{{image-border-color|}}}
      <div class="bg3wiki-image-quote-begin">“</div>
| class = bg3wiki-fancy-quote-image-{{{image-position|left}}}
      <!-- Actual text of the quote -->
}}}}
      <div style="font-style:italic">{{{quote}}}</div>
<!-- Formatted quote -->
      <!-- Ending quotation mark. Aligned with the bottom-right corner of the quote text -->
<blockquote style="font-size:{{{font-size|110%}}};" class="bg3wiki-fancy-quote-blockquote-{{{image-position|left}}}" >
      <div class="bg3wiki-image-quote-end">„</div>
  <div style="display:flex;align-items:center>
    </div>
    <!-- Starting quotation mark. Aligned with the top-left corner of the quote text -->
  </blockquote>
    <div class="bg3wiki-fancy-quote-begin">“</div>
  <!--- Optional author or attribution for the quote. Aligned with the bottom-right of the quote -->
    <!-- Actual text of the quote -->
  {{#if:{{{author|}}}|<div class="bg3wiki-image-quote-author>— {{{author|}}}</div>}}
    <div style="font-style:italic">{{{quote}}}</div>
</div>
    <!-- Ending quotation mark. Aligned with the bottom-right corner of the quote text -->
</div></includeonly><noinclude>
    <div class="bg3wiki-fancy-quote-end">„</div>
Display a quote with an accompanying image which are vertically aligned with each other.
  </div>
</blockquote>
<!--- Optional author or attribution for the quote. Aligned with the bottom-right of the quote -->
{{#if:{{{author|}}}|<div class="bg3wiki-fancy-quote-author">— {{{author|}}}</div>}}
{{#ifeq:{{{image-position|left}}}|left|<div style="grid-column:3"></div>}}
</div></includeonly><noinclude>{{documentation|content=
Display a fancily formatted quote with an (optional) accompanying image. This is a parent template used as a basis for other more specific quote templates. These are:
* {{t link|Quote character}}: Display character quotes with automatic handling of the character portrait.
In addition, the following quote template displays a set of predefined quotes. They are intended for use on their specific pages only rather than general purpose templates.
* {{t link|Quote ability}}: Display the quote corresponding to an [[ability]] (Strength, Dexterity, etc.).
* {{t link|Quote background}}: Display the quote corresponding to a [[background]].
* {{t link|Quote class}}: Display the quote corresponding to a [[Classes|class/subclass]].
* {{t link|Quote deity}}: Display the quote corresponding to a [[deity]].
* {{t link|Quote race}}: Display the quote corresponding to a [[race]], both playable and non-playable.
* {{t link|Quote skill}}: Display a quote corresponding to a [[Skills|skill]].
 
== See also ==
Refer to {{t link|Image frame}} for the template used to render the image.
 
This template has an associated stylesheet at [[Template:Quote fancy/style.css]].


== Examples ==
== Examples ==
{{Template demo
{{Template demo
| style = list
| style = list
| caption 1 = This is the default appearance for a quote with an image.
| <nowiki>
| <nowiki>
{{ImageQuote
{{Quote fancy
| quote = The operations of these huge steel juggernauts are powered by engines of churning hellfire.  
| quote = The operations of these huge steel juggernauts are powered by engines of churning hellfire.  
| image = Portrait Steel Watcher.png
| image = Portrait Steel Watcher.png
Line 34: Line 61:
}}
}}
</nowiki>
</nowiki>
| caption 2 = This example demonstrates some of the optional style parameters that can be adjusted.
| <nowiki>
| <nowiki>
{{ImageQuote
{{Quote fancy
| quote = These levitating eyes transmit all that they see to the one who created them.
| quote = These levitating eyes transmit all that they see to the one who created them.
| image = Portrait Scrying Eye.png
| image = Portrait Scrying Eye.png
| author = In-game racial description of [[Scrying Eye]]s
| author = In-game racial description of [[Scrying Eye]]s
| link = Scrying Eye
| link = Scrying Eye
| height = 60px
| height = 80
| rounding = 20%
| font-size = 120%
| font-size = 120%
| align = center
| image-align = edge
}}
}}
</nowiki>
</nowiki>
| caption 3 = For quotes of this style, see {{t link|Quote class}}.
| <nowiki>
| <nowiki>
{{ImageQuote
{{Quote fancy
| quote = The strong embrace the wild that hides inside - keen instincts, primal physicality, and most of all, an unbridled, unquenchable rage.
| quote = The strong embrace the wild that hides inside - keen instincts, primal physicality, and most of all, an unbridled, unquenchable rage.
| image = Class Barbarian Badge Icon.png
| image = Class Barbarian Badge Icon.png
| image-position = right
| image-position = right
| height = 160px
| image-align = edge
| height = 160
| font-size = 120%
| font-size = 120%
| link = Barbarian
| link = Barbarian
| align = center
}}
</nowiki>
| caption 4 = For quotes of this style, see {{t link|Quote character}}.
| <nowiki>
{{Quote fancy
| quote = Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
| image = Portrait Gale.png
| link = Gale
| author = [[Gale]], casting Knuth's Magnificent Kerning
| height = 60
| font-size = 100%
| image-border-shape = diamond
| image-border-width = 4
| image-border-color = black
}}
}}
</nowiki>
</nowiki>
Line 73: Line 115:
"description": "Add an image to go along with the quote.",
"description": "Add an image to go along with the quote.",
             "type": "wiki-file-name",
             "type": "wiki-file-name",
"example": "Portrait Lae'zel.png"
"example": "Portrait Lae'zel.png",
            "suggested": true
},
        "link": {
"label": "Link",
"description": "Clicking the image will link to the specified page instead of the image file.",
            "type": "wiki-page-name",
"example": "Lae'zel",
            "suggested": true
},
},
         "author": {
         "author": {
Line 88: Line 138:
             "default": "130%"
             "default": "130%"
},
},
"rounding": {
        "image-align": {
"label": "Rounding",
"label": "Image alignment",
"description": "The amount of rounding applied to the image.",
"description": "How to align the image with the quote. Either centered along with the quote (default) or kept at the edge.",
             "type": "string",
             "type": "string",
             "example": "50%, 20px",
             "suggestedvalues": ["center", "edge"],
             "default": "15%"
             "default": "center"
},
},
         "align": {
         "image-position": {
"label": "Alignment",
"label": "Image position",
"description": "Horizontal alignment of the quote",
"description": "Position of the image relative to the quote.",
             "type": "string",
             "type": "string",
             "example": "left, right, center",
             "suggestedvalues": ["left", "right"],
             "default": "left"
             "default": "left"
},
},
         "image-position": {
         "image-border-width": {
"label": "Image position",
"label": "Image border width",
"description": "Position of the image relative to the quote",
"description": "Width in pixels of the border around the image. Set to 0 to completely disable this.",
            "type": "number",
            "default": "0"
},
        "image-border-shape": {
"label": "Image border shape",
"description": "Shape of the border frame which crops the image. This can be an arbitrary CSS clip-path or a predefined value. Refer to [[Template:Image frame]] for details. The default value of basic disables this.",
            "type": "string",
            "suggestedvalues": ["rounded", "diamond", "basic"],
            "example": "circle(60% at 50% 50%)",
            "default": "basic"
},
        "image-border-color": {
"label": "Image border color",
"description": "Color of the image border. This can be a CSS color descriptor.",
             "type": "string",
             "type": "string",
             "example": "left, right",
             "example": "#3d3d3d",
             "default": "left"
             "default": "black"
},
},
         "height": {
         "height": {
"label": "Height",
"label": "Height",
"description": "The height of the image",
"description": "The height of the image in pixels.",
             "type": "string",
             "type": "string",
             "example": "60px, 4em",
             "example": "60px, 50",
             "default": "80px"
             "default": "80"
}
}
},
},
Line 120: Line 184:
     "format": "block"
     "format": "block"
}
}
</templatedata>
</templatedata>}}
[[Category: Templates]]
[[Category: Templates]]
[[Category: Quotation templates]]
[[Category: Quotation templates]]
</noinclude>
</noinclude>

Latest revision as of 18:17, 30 July 2024

Template documentation

Display a fancily formatted quote with an (optional) accompanying image. This is a parent template used as a basis for other more specific quote templates. These are:

  • {{Quote character}}: Display character quotes with automatic handling of the character portrait.

In addition, the following quote template displays a set of predefined quotes. They are intended for use on their specific pages only rather than general purpose templates.

See also

Refer to {{Image frame}} for the template used to render the image.

This template has an associated stylesheet at Template:Quote fancy/style.css.

Examples

This is the default appearance for a quote with an image.

Markup
{{Quote fancy
| quote = The operations of these huge steel juggernauts are powered by engines of churning hellfire. 
| image = Portrait Steel Watcher.png
| link = Adamantine Golem
}}
Renders as
Portrait Steel Watcher.png
The operations of these huge steel juggernauts are powered by engines of churning hellfire.

This example demonstrates some of the optional style parameters that can be adjusted.

Markup
{{Quote fancy
| quote = These levitating eyes transmit all that they see to the one who created them.
| image = Portrait Scrying Eye.png
| author = In-game racial description of [[Scrying Eye]]s
| link = Scrying Eye
| height = 80
| font-size = 120%
| image-align = edge
}}
Renders as
Portrait Scrying Eye.png
These levitating eyes transmit all that they see to the one who created them.
— In-game racial description of Scrying Eyes

For quotes of this style, see {{Quote class}}.

Markup
{{Quote fancy
| quote = The strong embrace the wild that hides inside - keen instincts, primal physicality, and most of all, an unbridled, unquenchable rage.
| image = Class Barbarian Badge Icon.png
| image-position = right
| image-align = edge
| height = 160
| font-size = 120%
| link = Barbarian
}}
Renders as
Class Barbarian Badge Icon.png
The strong embrace the wild that hides inside - keen instincts, primal physicality, and most of all, an unbridled, unquenchable rage.


For quotes of this style, see {{Quote character}}.

Markup
{{Quote fancy
| quote = Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
| image = Portrait Gale.png
| link = Gale
| author = [[Gale]], casting Knuth's Magnificent Kerning
| height = 60
| font-size = 100%
| image-border-shape = diamond
| image-border-width = 4
| image-border-color = black
}}
Renders as
Portrait Gale.png
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Gale, casting Knuth's Magnificent Kerning

Template data

Display a quote with an accompanying image which are aligned with each other

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Quotequote

The quote

Stringrequired
Imageimage

Add an image to go along with the quote.

Example
Portrait Lae'zel.png
Filesuggested
Linklink

Clicking the image will link to the specified page instead of the image file.

Example
Lae'zel
Page namesuggested
Authorauthor

The author or context of the quote

Stringoptional
Font sizefont-size

Size of the font used for the quote.

Default
130%
Example
100%, 1.1em
Stringoptional
Image alignmentimage-align

How to align the image with the quote. Either centered along with the quote (default) or kept at the edge.

Suggested values
center edge
Default
center
Stringoptional
Image positionimage-position

Position of the image relative to the quote.

Suggested values
left right
Default
left
Stringoptional
Image border widthimage-border-width

Width in pixels of the border around the image. Set to 0 to completely disable this.

Default
0
Numberoptional
Image border shapeimage-border-shape

Shape of the border frame which crops the image. This can be an arbitrary CSS clip-path or a predefined value. Refer to [[Template:Image frame]] for details. The default value of basic disables this.

Suggested values
rounded diamond basic
Default
basic
Example
circle(60% at 50% 50%)
Stringoptional
Image border colorimage-border-color

Color of the image border. This can be a CSS color descriptor.

Default
black
Example
#3d3d3d
Stringoptional
Heightheight

The height of the image in pixels.

Default
80
Example
60px, 50
Stringoptional