Mabinogi World Wiki is brought to you by Coty C., 808idiotz, our other patrons, and contributors like you!!
Want to make the wiki better? Contribute towards getting larger projects done on our Patreon!

NOTICE: Seems like daily VIP shadow missions may be wrong occasionally!!

Difference between revisions of "User:Erorserv/Semantic Cheat Sheet"

From Mabinogi World Wiki
Jump to: navigation, search
(Created page with "<code><nowiki>#set</nowiki></code> is used to set semantic properties to that page. E.g. <pre>{{#set: |Monster name=Brown Fox |Monster family=Fox }}</pre> It's possible to u...")
 
Line 1: Line 1:
<code><nowiki>#set</nowiki></code> is used to set semantic properties to that page. E.g.
+
==Set Semantic Properties==
 
+
''Semantic properties can set a value for a specific page, and allows the page to be queried later.''<br/>
 +
<code><nowiki>#set</nowiki></code> is used to set semantic properties to that page.
 
<pre>{{#set:
 
<pre>{{#set:
 
|Monster name=Brown Fox
 
|Monster name=Brown Fox
Line 6: Line 7:
 
}}</pre>
 
}}</pre>
  
It's possible to use this in a template, i.e.
+
It's possible to use this in a template. Example: <code><nowiki>{{SemanticData}}</nowiki></code>
 
 
 
<pre>{{#set:
 
<pre>{{#set:
 
|Monster name={{{Name|}}}
 
|Monster name={{{Name|}}}
 
|Monster family={{{Family|}}}
 
|Monster family={{{Family|}}}
 
}}</pre>
 
}}</pre>
 +
These semantic properties will be set on each page that uses the template.
  
'''<nowiki>#parameterstohash</nowiki>''' will define all the template parameters to a hash table.<br>
+
==Hashtables==
<code><nowiki>{{#parameterstohash:Data}}</nowiki></code>
+
''Hashtables will assign values to a table, similar to an array, and is accessible by all templates on the page.''
  
'''<nowiki>#hashvalue</nowiki>''' is used to get a single value from a hashtable.<br>
+
<code><nowiki>{{#parameterstohash:Data}}</nowiki></code> will define all the template parameters to a hash table.<br>
<code><nowiki>{{#hashvalue:Data|Name}}</nowiki></code>
+
<code><nowiki>{{#hashvalue:Data|Name}}</nowiki></code> is fetch a single value from that hashtable.<br>
 +
*Hashtables are only necessary if the values are accessed by multiple templates.
  
to be added
+
==Semantic Query==
 +
''Querys are used to obtain pages that have certain values.''
 +
<pre>
 +
{{#ask:
 +
[[Category:Potions]]
 +
|format=plainlist
 +
}}
 +
</pre>
 +
This will return a list of pages under the Potions category.
 +
<code>|format</code> returns the results in a certain format. For a list of formats, [https://www.semantic-mediawiki.org/wiki/Help:Result_formats see here]

Revision as of 23:02, 4 August 2019

Set Semantic Properties

Semantic properties can set a value for a specific page, and allows the page to be queried later.
#set is used to set semantic properties to that page.

{{#set:
|Monster name=Brown Fox
|Monster family=Fox
}}

It's possible to use this in a template. Example: {{SemanticData}}

{{#set:
|Monster name={{{Name|}}}
|Monster family={{{Family|}}}
}}

These semantic properties will be set on each page that uses the template.

Hashtables

Hashtables will assign values to a table, similar to an array, and is accessible by all templates on the page.

{{#parameterstohash:Data}} will define all the template parameters to a hash table.
{{#hashvalue:Data|Name}} is fetch a single value from that hashtable.

  • Hashtables are only necessary if the values are accessed by multiple templates.

Semantic Query

Querys are used to obtain pages that have certain values.

{{#ask:
[[Category:Potions]]
|format=plainlist
}}

This will return a list of pages under the Potions category. |format returns the results in a certain format. For a list of formats, see here