Editing User:Khaim

Jump to navigation Jump to search

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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
  
 
==How-To: Properties & Queries==
 
==How-To: Properties & Queries==
 +
 +
'''MediaWiki references'''
 +
* [https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types Properties]
 +
* [https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages Query syntax]
 +
* [https://www.semantic-mediawiki.org/wiki/Help:Displaying_information Display syntax]
 +
* [https://www.semantic-mediawiki.org/wiki/Help:Result_formats Result formats]
  
 
===Property Syntax===
 
===Property Syntax===
  
====Adding properties to pages====
+
''TODO''
 
 
* Basic syntax: <tt><nowiki>[[Example property::value]]</nowiki></tt>
 
** How this looks on the page depends on the property's ''type''. The default type is [[Special:Types/Page|Page]], which will display this the same as <nowiki>[[value]]</nowiki>, i.e. the text 'value' which links to the wikipage 'value'.
 
** Properties with the [[Special:Types/Number|Number]] type - very common on this wiki - will not add a link. They will just display as 'value'.
 
* Alternate display text: <tt><nowiki>[[Example property::value|alt-text]]</nowiki></tt>
 
** Displays as either <nowiki>[[value|alt-text]]</nowiki>, for page links; or 'alt-text', for numbers.
 
* Set property without displaying anything: <tt><nowiki>[[Example property::value| ]]</nowiki></tt>
 
** The space is required.
 
 
 
If you add a property to a page, check that it's defined! If it isn't, the wiki will use the defaults, which are terrible. In this case you should create the property page yourself.
 
 
 
====Defining Properties====
 
 
 
Property is defined by special pages with the '''Property:''' prefix. For example, the "Beauty Base" property is defined by [[Property:Beauty_Base]]. At minimum a property page needs to define its type.
 
* Basic syntax: <tt><nowiki>[[has property::type| ]]</nowiki></tt>
 
** On this wiki the type should probably be either 'number' or 'page'.
 
** This is the exact same syntax as adding a property to a normal page. That's because ''has_type'' is also a property; it's a special built-in property.
 
* Helper template: <tt><nowiki>{{Property with Page | page = Beauty | type = Number }}</nowiki></tt>
 
** This sets the type and also displays ''See [[Beauty]]'' to link to the page that describes what this property is.
 
 
 
A property's page is also a wiki page, so you can add content to it as normal. It's fine to leave it blank.
 
  
 
===Query Syntax===
 
===Query Syntax===
Line 52: Line 37:
 
Query output:
 
Query output:
 
{{#ask:
 
{{#ask:
[[Skill Base Factor::>0.4]]
+
[[Skill Base Factor::+]]
 
[[Skill Bonus Factor::+]]
 
[[Skill Bonus Factor::+]]
 
| ?Skill Base Factor# = Base
 
| ?Skill Base Factor# = Base
Line 64: Line 49:
  
 
Comments:
 
Comments:
<nowiki>{{#ask:  // Begin a query.
+
<nowiki>{{#ask:  // Begin a query.
 
 
 
// Everything up to the next | is the query term. This particular example returns pages which:
 
// Everything up to the next | is the query term. This particular example returns pages which:
 
[[Skill Base Factor::>0.4]]  // have the Skill_Base_Factor property, value is >0.4
 
[[Skill Base Factor::>0.4]]  // have the Skill_Base_Factor property, value is >0.4
 
[[Skill Bonus Factor::+]]    // AND have the Skill_Bonus_Factor property, with any value
 
[[Skill Bonus Factor::+]]    // AND have the Skill_Bonus_Factor property, with any value
 
+
// Define how the results are displayed.
// Define columns to show. The first column is the page name.
+
//  For a table, the first column is the page name.
 
| ?Skill Base Factor# = Base  // The second column is the page's Skill_Base_Factor value, with heading 'Base'.
 
| ?Skill Base Factor# = Base  // The second column is the page's Skill_Base_Factor value, with heading 'Base'.
| ?Skill Bonus Factor# = Factor // The third column is Skill_Bonus_Factor, with heading 'Factor'
+
| ?Skill Bonus Factor# = Factor
| mainlabel = Stat  // The heading for the first column.
+
| format = table  // 'format = broadtable' makes a table as wide as the screen. Optional.
 
+
| limit  = 100  // Maximum number of pages to return. Optional.
// Optional settings.
+
| mainlabel = Stat  // The heading for the first column (with the page name).
| format = table  // This makes a fitted table. 'format = broadtable' makes a table as wide as the screen.
+
| sort = Skill Base Factor,Skill Bonus Factor  // Sort by base factor, then bonus factor. Optional.
| limit  = 100  // Maximum number of pages to return.
 
| sort = Skill Base Factor,Skill Bonus Factor  // Sort by base factor, then bonus factor.
 
 
| order = desc,desc
 
| order = desc,desc
 
}}</nowiki>
 
}}</nowiki>
 
===MediaWiki references===
 
* [https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types Properties]
 
* [https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages Query syntax]
 
* [https://www.semantic-mediawiki.org/wiki/Help:Displaying_information Display syntax]
 
* [https://www.semantic-mediawiki.org/wiki/Help:Result_formats Result formats]
 
* [https://www.semantic-mediawiki.org/wiki/Help:Special_properties Special properties]
 

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld 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)