Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Crystal: Difference between revisions

Template page
Add reusable infobox picture field and fallback
Clean Cargo schema and editing workflow
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
|PreferredLuck={{{preferred luck|}}}
|PreferredLuck={{{preferred luck|}}}
|Technique={{{technique|}}}
|Technique={{{technique|}}}
|Weight={{{weight|}}}
|PreferredHerbs={{{preferred herbs|}}}
|Description={{{description|}}}
|Description={{{description|}}}
}}
}}
Line 15: Line 13:
<div class="hw-record-summary">{{{description|No description available.}}}</div>
<div class="hw-record-summary">{{{description|No description available.}}}</div>
</div>
</div>
<div class="hw-record-actions">[[Special:FormEdit/Crystal/{{FULLPAGENAME}}|Edit record]] [{{fullurl:Special:MultiPageEdit|template=Crystal&form=Crystal}} Bulk edit crystals] [{{fullurl:{{FULLPAGENAME}}|action=delete}} Delete record]</div>
<div class="hw-infobox hw-crystal-infobox hw-crystal-rarity-{{{rarity|Unknown}}}">
<div class="hw-infobox hw-crystal-infobox hw-crystal-rarity-{{{rarity|Unknown}}}">
<div class="hw-infobox-title">{{{name|{{PAGENAME}}}}}</div>
<div class="hw-infobox-title">{{{name|{{PAGENAME}}}}}</div>
<div class="hw-infobox-badge">{{{rarity|Unknown}}} crystal</div>
<div class="hw-infobox-badge">{{{rarity|Unknown}}} crystal</div>
<div class="hw-infobox-image" role="group" aria-label="Image for {{{name|{{PAGENAME}}}}}">
<div class="hw-infobox-image" role="group" aria-label="Image for {{{name|{{PAGENAME}}}}}">
{{#if:{{{image|}}}|[[File:{{{image}}}|frameless|600px|alt={{{name|{{PAGENAME}}}}}]]|<div class="hw-infobox-image-empty">No Picture Uploaded</div>}}
{{{image|<div class="hw-infobox-image-empty">No Picture Uploaded</div>}}}
</div>
</div>
<div class="hw-infobox-heading">Crystal Effects</div>
<div class="hw-infobox-heading">Crystal Effects</div>
Line 25: Line 24:
<div class="hw-infobox-row"><div class="hw-infobox-label">Preferred Luck</div><div class="hw-infobox-value">×{{{preferred luck|—}}}</div></div>
<div class="hw-infobox-row"><div class="hw-infobox-label">Preferred Luck</div><div class="hw-infobox-value">×{{{preferred luck|—}}}</div></div>
<div class="hw-infobox-row"><div class="hw-infobox-label">Technique</div><div class="hw-infobox-value">×{{{technique|—}}}</div></div>
<div class="hw-infobox-row"><div class="hw-infobox-label">Technique</div><div class="hw-infobox-value">×{{{technique|—}}}</div></div>
<div class="hw-infobox-row"><div class="hw-infobox-label">Loot Weight</div><div class="hw-infobox-value">{{{weight|—}}}</div></div>
<div class="hw-infobox-heading">Preferred Herbs</div>
<div class="hw-infobox-heading">Preferred Herbs</div>
<div class="hw-infobox-blurb">{{#arraymap:{{{preferred herbs|}}}|;|herb|[[herb]]|, }}</div>
<div class="hw-infobox-blurb">{{#cargo_query:
tables=Herbs
|fields=_pageName
|where=PreferredCrystals HOLDS "{{PAGENAME}}"
|order by=_pageName
|format=list
|default=None recorded
}}</div>
</div>
</div>
</includeonly><noinclude>
</includeonly><noinclude>
Line 37: Line 42:
|PreferredLuck=Float
|PreferredLuck=Float
|Technique=Float
|Technique=Float
|Weight=Integer
|PreferredHerbs=List (;) of Page
|Description=Text
|Description=Text
}}
}}
This template stores and displays one centralized crystal record.
This template stores and displays one centralized crystal record. Crystal weight is no longer part of the data model. Preferred herbs are derived from the canonical <code>Herbs.PreferredCrystals</code> relation and are never stored independently here.
 
== Usage ==
<pre>
{{Crystal
| name = Flame Crystal
| rarity = Mortal
| universal luck = 1.2
| preferred luck = 1.5
| technique = 1.1
| weight = 12
| preferred herbs = Crimson Sun Grass;Yang Lotus
| description = A basic flame aspect crystal.
}}
</pre>
 
Set <code>| image = Example.png</code> to display an uploaded file in the infobox. Leave it empty to show “No Picture Uploaded”.
[[Category:Infobox templates]]
[[Category:Infobox templates]]
</noinclude>
</noinclude>

Latest revision as of 22:04, 13 September 2026

This template defines the table "Crystals". View table. This template stores and displays one centralized crystal record. Crystal weight is no longer part of the data model. Preferred herbs are derived from the canonical Herbs.PreferredCrystals relation and are never stored independently here.