Jump to content

Template:Overfloat image/doc

From Wikisource

Overfloats items on one image. For example, text captions may be floated over the white-space in an image.

Usage

[edit]

The letters 'px' are hard-coded in the template. Use digits only and omit 'px'.

{{overfloat image
 | image  =
 | width  =
 | item1  =
 | hpos1  =
 | vpos1  =
 | x1     =
 | y1     =
 | width1 =
 | height1=
 | border1=
 | ts1    =
 | item2  =
 | hpos2  =
 | vpos2  =
 | x2     =
 | y2     =
 | width2 =
 | height2=
 | border2=
 | ts2    =
 ...
}}

Parameters

[edit]
  • image: The image and all related code. Should include the [[File:...]] elements.
  • width: (Optional) The width (in pixels) of the div in which to place the image and overfloated items. Should be equal or above the size of the image. Defaults to 400.
  • itemi: The item to be overfloated. If text, the templates {{block left}}, {{block center}} or {{block right}} are useful.
  • hposi: (Optional) Sets the horizontal edge position of the item to either left or right. Defaults to left.
  • vposi: (Optional) Sets the vertical edge position of the item to either top or bottom. Defaults to top.
  • xi: (Optional) Sets the size of the margin of the horizontal position. Defaults to 0.
  • yi: (Optional) Sets the size of the margin of the vertical position. Defaults to 0.
  • widthi: (Optional) Sets the horizontal size of item block. No default.
  • heighti: (Optional) Sets the vertical size of item block. No default.
  • borderi: (Optional) Sets the border style of item block (debugging aid). No border by default.
  • vertical-aligni: (Optional) If set, render item block in a table cell, which is passed a vertical alignment directive. Useful values are "top", "middle" or "bottom". No table cell by default.

The numbered parameters are only used if the corresponding item is used. For example, x2 and y2 are only used if item2 is used.

Examples

[edit]
{{overfloat image
 | image = [[File:Amazing Stories v01n01 p092 The Facts in the Case of M Valdemar.png|400px|center]]
 | item1 = {{block left
             |width=400
             |{{gap}}{{x-larger|''The''}} {{xx-larger|{{sc|'''Facts'''}}}}<br />{{x-larger|''in the''}} {{xx-larger|{{sc|'''Case'''}}}} {{x-larger|''of''}}<br />{{xx-larger|{{sc|'''M. Valdemar'''}}}}
{{c|{{larger|''by''}}}}
{{larger|''Edgar Allan Poe''}}
           }}
 | y1    = 50
}}
The Facts
in the Case of
M. Valdemar

by

Edgar Allan Poe

{{overfloat image
 | image = [[File:WeirdTalesv24n3pg352 Trail of the Cloven Hoof.png|center|600px]]
 | width = 600
 | item1 = {{block center|width=150px|{{larger|By ARLTON EADIE}}}}
 | x1    = 230
 | y1    = 0
 | item2 = {{block right|width=175px|{{smaller|"One look was enough. I snapped off my flashlight and fled."}}}}
 | hpos2 = right
 | y2    = 425
}}

By ARLTON EADIE

"One look was enough. I snapped off my flashlight and fled."

Notes
[edit]
  • This example shows how to dynamically vertical centre a text block within a frame.
{{overfloat image
 | image = [[File:The Pathway of Roses, Larson (1913) decoration on page 5.jpg|frameless|center|400px]]
 | item1 = <div style="line-height:1.5; text-indent:1em; margin-left:0; font-style:italic;
font-size:92%; text-align:justify;"><div>''To give the world emancipation is the ruling desire of all<!--
--> minds that are spiritually awakened; and these should remember that to overcome evil with good is the only way.<!--
--> Forget the wrong that may appear in the outer world of things, and give all your thought to the great good that is<!--
--> inherent in all things. You thereby place in action the greatest emancipating power that the human race will ever<!--
--> know.''</div>
<div>''We are in bondage because we have lived to please the person. Follow the soul and freedom shall come quickly.<!--
--> Then we shall please the person better than ever before. To follow the soul is to enter the greater domains of life,<!--
--> those domains from which we may secure everything that is rich and beautiful and superior in human existence. The<!--
--> soul leads, not only into the life more abundant, but also into the actual possession of all the spiritual riches<!--
--> that the greater life may contain. And when we find the kingdom that is within, all that we may desire in the<!--
--> without shall be added.''</div>
<div>''The soul that lives most perfectly in the present, creates most nobly for the future. Be yourself to-day,<!--
--> regardless of what happened yesterday. Be all that you are or can be to-day, and you will live in a fairer world<!--
--> to-morrow.''</div></div>
 | x1 = 50
 | y1 = 50
 | height1 = 553
 | width1 = 300
 | ts1 = middle
}}
To give the world emancipation is the ruling desire of all minds that are spiritually awakened; and these should remember that to overcome evil with good is the only way. Forget the wrong that may appear in the outer world of things, and give all your thought to the great good that is inherent in all things. You thereby place in action the greatest emancipating power that the human race will ever know.
We are in bondage because we have lived to please the person. Follow the soul and freedom shall come quickly. Then we shall please the person better than ever before. To follow the soul is to enter the greater domains of life, those domains from which we may secure everything that is rich and beautiful and superior in human existence. The soul leads, not only into the life more abundant, but also into the actual possession of all the spiritual riches that the greater life may contain. And when we find the kingdom that is within, all that we may desire in the without shall be added.
The soul that lives most perfectly in the present, creates most nobly for the future. Be yourself to-day, regardless of what happened yesterday. Be all that you are or can be to-day, and you will live in a fairer world to-morrow.
  • An example with |polygon= (see {{img float}}) and a "drop initial" effect.
{{{img float
 | file     = Page 33 initial in fairy tales of Andersen (Stratton).png
 | width    = 200px
 | align    = left
 | polygon = 0 0, 77% 0, 77% 73%, 97% 73%, 97% 100%, 0 100%
}}HERE is no one in the world who knows so many stories as Olé Luk-Oie, and nobody can tell them so prettily. 

Towards evening when the children are sitting round the table, or upon their stools, in steals Olé Luk-Oie. He comes upstairs very softly, for he walks about in his socks, and then opens the doors so gently—and, heigh presto! he squirts dust into the children’s eyes, in very, very small quantities, yet sufficient to prevent their keeping their eyes open, and that’s why they can’t ever see him. He slinks behind them, and breathes softly over their necks, and then their heads begin to feel heavy. But don’t think he hurts them. Oh, no! Olé Luk-Oie means kindly towards all children—he only wants them to be quiet, and that they never are till they have been put to bed; and he merely wishes them to be quiet in order that he may tell them pretty stories.

So, when the children have fallen to sleep, Ole Luk-Oie sits upon their bed. He is very well dressed, for his coat is made of some silk stuff, though it is impossible to tell its colour, for it changes from green to red or to blue, according to which side he turns. He carries an umbrella under each arm, and he spreads one of these, all lined with pretty pictures, over the heads of good children, which makes them dream of amusing stories all night long; but as for the other umbrella, which is completely blank, he spreads that over naughty children, who then sleep so heavily that next morning when they wake they find they have dreamed nothing at all.

HERE is no one in the world who knows so many stories as Olé Luk-Oie, and nobody can tell them so prettily.

Towards evening when the children are sitting round the table, or upon their stools, in steals Olé Luk-Oie. He comes upstairs very softly, for he walks about in his socks, and then opens the doors so gently—and, heigh presto! he squirts dust into the children’s eyes, in very, very small quantities, yet sufficient to prevent their keeping their eyes open, and that’s why they can’t ever see him. He slinks behind them, and breathes softly over their necks, and then their heads begin to feel heavy. But don’t think he hurts them. Oh, no! Olé Luk-Oie means kindly towards all children—he only wants them to be quiet, and that they never are till they have been put to bed; and he merely wishes them to be quiet in order that he may tell them pretty stories.

So, when the children have fallen to sleep, Ole Luk-Oie sits upon their bed. He is very well dressed, for his coat is made of some silk stuff, though it is impossible to tell its colour, for it changes from green to red or to blue, according to which side he turns. He carries an umbrella under each arm, and he spreads one of these, all lined with pretty pictures, over the heads of good children, which makes them dream of amusing stories all night long; but as for the other umbrella, which is completely blank, he spreads that over naughty children, who then sleep so heavily that next morning when they wake they find they have dreamed nothing at all.

See also

[edit]