Difference between revisions of "Template:Book"
(update to new template) |
|||
| Line 1: | Line 1: | ||
<includeonly>{| | <includeonly><!-- | ||
| | --- If item name is provided as parameter, use the parameter instead of root page. --- | ||
-->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!-- | |||
--- Load complete datastring into a variable and load content into another variable (due to string size limits) --- | |||
-->{{#vardefine:Datastring|{{:Book_data|{{#var:Page}}}}}}<!-- | |||
-->{{#vardefine:Content|{{:Book_data|{{#var:Page}} Content}}}}<!-- | |||
--- Separate values from datastring into individual variables. --- | |||
-->{{#vardefine:Category|{{#explode: {{#var:Datastring}}|§|0}}}}<!-- | |||
-->{{#vardefine:Subcategory|{{#explode: {{#var:Datastring}}|§|1}}}}<!-- | |||
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|§|2}}}}<!-- | |||
-->{{#vardefine:Tags|{{#explode: {{#var:Datastring}}|§|6}}}}<!-- | |||
-->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|§|7}}}}<!-- | |||
-->{{#vardefine:MiddleText|{{#explode: {{#var:Datastring}}|§|8}}}}<!-- | |||
-->{{#vardefine:BookType|{{#explode: {{#var:Datastring}}|§|9}}}}<!-- | |||
-->{{#vardefine:Name|{{#explode: {{#var:Datastring}}|§|10}}}}<!-- | |||
-->{{#vardefine:Image|{{#explode: {{#var:Datastring}}|§|11}}}}<!-- | |||
--- Load translations that are used multiple times into variables. --- | |||
-->{{#vardefine:TranslateName|{{Translate|{{#if:{{#var:Name}}|{{#var:Name}}|{{#var:Page}}}}|Books}}}}<!-- | |||
-->{{#vardefine:TranslatePrice|{{Translate|Price|Properties}}}}<!-- | |||
-->{| width=300px; | |||
|style="text-align:center;"|<span style="font-size: 20px;">{{#var:TranslateName}}</span><br> | |||
<span style="text-align:center;color:#9d9a9a;">{{#var:BookType}}</span>{{Tooltip rule}} | |||
|- | |- | ||
|{{#if: {{#var:MiddleText}}|{{#var:MiddleText}}{{Tooltip rule}}|}} | |||
|- | |- | ||
|style="color:#9d7969;text-align:justify"|{{ | |style="color:#9d7969;text-align:justify"|{{Translate|{{#var:Description}}|Books}}{{#if:{{#var:Price}}|<div style="float: right;">[[File:Gold_Icon.png|18px|alt={{#var:TranslatePrice}}|link=|{{#var:TranslatePrice}}]]{{c|white|{{#var:Price}}}}</div>}}<br> | ||
|- | |- | ||
|style="text-align:center;"|[[File:{{#if:{{: | |style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{#var:Page}}.png}}|link=|class=image2x|alt={{Translate|{{ROOTPAGENAME}}|Treatises}}|{{Translate|{{ROOTPAGENAME}}|Treatises}}]] | ||
|} | |} | ||
</includeonly><noinclude>{{doc}} | </includeonly><noinclude>{{doc}} | ||
[[Category:Tooltip templates]]</noinclude> | [[Category:Tooltip templates]]</noinclude> | ||
Revision as of 16:31, 21 June 2023
This is treatise template created for use together with the Template:Tooltip hover box template on a specific Books & Notes page or Treatises page.
Usage
The book's data is loaded from Book data. This syntax provides the tooltip look and content loaded via the {{Book}} template. Use on pages is combined with float CSS, positioning the result to the right.
<div style="float: right">{{ {{{1|Tooltip hover box}}}|title= {{Book}}}}</div>
By default the page name is used as the book name. If you want to load a specific book on any page, you can provide its name as a parameter, for example:
{{ {{{1|Tooltip hover box}}}|title= {{Book|Pyromancy Treatise IV}}}}
| Pyromancy Treatise IV Written by Jovar Arno |
| "A Tale of the Everflaming, as Told by a Jibean Merchant" Allows you to learn the following Pyromancy abilities: Inferno Excess Heat Pyromania Reading this book grants some Experience. |
| Written by a renown wayfarer, these road notes are dedicated to a sect of fire-worshiping dervishes. The detailed description of some of their rituals looks particularly promising. |
| Book |
Book Content
You can also load the text that's written inside a book or treatise by using this transclusion syntax:
{{:Book data|Pyromancy Treatise IV Content}}
...They surrounded me, and, for a brief moment, I feared that I was to share the fate of the poor sod whose charred remains we had stumbled upon at the crossroad. However, they seemed friendly enough, even if the sight of their eerie masks unnerved me greatly.
( . . . )
Once we were done with our dinner, the priest - I could only assume he was a priest - gestured for us to leave the tent. Weighed down by the heavy meal, we reluctantly followed him outside. To our astonishment, we were met by the sight of a huge crowd, even though just a couple hours ago there were hardly more than a few dozen elves in the entire camp. The pitch-black darkness of the night was no match to the blinding light of hundreds of flames. The moon, as if terrified of the competition, hid behind the sudden clouds. The priest marched onwards, confidently pushing people aside and creating a path for us to follow...
( . . . )
The song came to a halt, leaving us in thick, oppressive silence. For a few minutes we just stood there, exchanging confused looks, when suddenly, huge gouts of fire erupted out of thin air and engulfed the people sitting in the middle of the circle. The crowd roared, then burst into wild dance, utterly enraptured. The burning dervishes remained in their place as if nothing had happened - I believe I even spotted a faint smile on one of their faces. Terrified, we attempted to flee, vainly trying to get through the rows of spinning nomads as they drew closer and closer...