Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Special pages
Random page
Wiki Discord
Contents
Neighbors
Galaxy
> Hexia
> Norvan
> Pashah
> Taffeh
Creatures
> Insects
> Fishes
> Shore-Dwellers
Items
> Dishes
> Furniture
Game Systems
> Dress Up
> Luca Arbor
> Loomix Footprints
> Loomix Vehicle Services
> Loomix Homes
Search
Search
Appearance
Log in
Personal tools
Log in
Editing
Template
:
Data to Table/doc
(section)
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== ===Lua Table=== A basic DPL query can be converted into a Lua data table: <pre> {{Data to Table |keys=number;;quality;;galaxy |unquoted=number |info={{#DPL: |namespace= |category=Fish |uses=Template:Creature Infobox |include={Creature Infobox}:%PAGE%,{Creature Infobox}:number,{Creature Infobox}:quality,{Creature Infobox}:distribution |format=,,, |secseparators=page==,;;number==,,;;quality==,,;;galaxy==,,$$$ }} }} </pre> This produces output in the following format: {{sh|<nowiki>return { ['Anchovy'] = { ['number'] = 074, ['quality'] = 'Gray', ['galaxy'] = 'Taffeh', }, ['Barred Spinefoot'] = { ['number'] = 085, ['quality'] = 'Purple', ['galaxy'] = 'All Regions', }, }</nowiki>|lua}} ===Constant Values=== {{F|value}} can be used when every entry should have the same value: <pre> {{Data to Table |value=day |info={{#DPL: |namespace=File |category=Icons to Invert |format=,page==%PAGE%$$$,, }} }} </pre> This produces: {{sh|<nowiki>return { ['Crab Icon.png'] = 'day', ['Crayfish Icon.png'] = 'day', ['Fish Icon.png'] = 'day', }</nowiki>|lua}} If the value should be output as a raw Lua value rather than a string, include {{F|value}} in {{F|unquoted}}. ===Simple JSON Array=== JSON mode can also be used without groups: <pre> {{Data to Table |json=1 |info={{#DPL: |namespace=File |category=Icons to Invert |format=,page==%PAGE%$$$,, }} }} </pre> This produces: {{sh|<nowiki>[ "Crab Icon.png", "Crayfish Icon.png", "Fish Icon.png" ]</nowiki>|json}} ===Grouped JSON=== Multiple DPL queries can be combined into a single JSON object using groups: <pre> {{Data to Table |json=1 |group1=day |group1_info={{#DPL: |namespace=File |category=Icons to Invert |format=,page==%PAGE%$$$,, }} |group2=night |group2_info={{#DPL: |namespace=File |category=Icons to Invert Night |format=,page==%PAGE%$$$,, }} }} </pre> This produces: {{sh|<nowiki>{ "day": [ "Crab Icon.png", "Crayfish Icon.png", "Fish Icon.png" ], "night": [ "Special Icon.png" ] }</nowiki>|json}} Groups with no results are automatically omitted. For example, if the night category is empty, the output will simply be: {{sh|<nowiki>{ "day": [ "Crab Icon.png", "Crayfish Icon.png", "Fish Icon.png" ] }</nowiki>|json}} ===Multiple Groups=== Additional groups can be added by continuing the numbering: <pre> |group1=day |group1_info=... |group2=night |group2_info=... |group3=special |group3_info=... </pre> Up to {{F|group10}} / {{F|group10_info}} are supported.
Summary:
Please note that all contributions to The Petit Planet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Petit Planet Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
File Pages
==Summary==
==Licensing==
{{Fairuse}}
{{File|}}
Dynamic Page List
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
¹
^2{
}^2
^2{¹}^2
Parser Functions
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder|}}
Magic Words
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
HTML Entities
—
,
­
Search
Search
Editing
Template
:
Data to Table/doc
(section)
Add topic