Changes

Jump to navigation Jump to search

Semantic wiki formatting

208 bytes added, 16:40, 12 November 2015
→‎Dealing with multiple values: divided the wrong and correct way by colour
When using semantic properties, be it in the infoboxes or the body of the article itself, you will inevitably encounter a problem - what to do when I have multiple values of the same property? Thankfully, the solution is not complicated. Consider a following example case. You are writing about a device that features three sensors: accelerometer, thermometer, and barometer. And you want all these three categories to be recognized by the semantic wiki. The correct way is to use the property <code>Has sensors</code> multiple times! Compare the two lines below:
<div style="background-color: #FFCCCC; border: 1px solid #FFB2B2; padding: 10px; margin-bottom: 1em;">'''The wrong way: ''' <code><nowiki>[[Has sensors::accelerometer, thermometer, barometer]]</nowiki></code> This will not work correctly because the system will consider this to be just one sensor that is called accelerometer, thermometer, barometer.</div>
<div style="background-color: #E9FFE6; border: 1px solid #CEF2E0; padding: 10px;">'''The correct way: ''' <code><nowiki>[[Has sensors::accelerometer]], [[Has sensors::thermometer]], [[Has sensors::barometer]]</nowiki></code> This time around we used the property <code>Has sensors</code> multiple times, individually for each of the sensors. The wiki will now understand that the device you are writing about features three different sensors. Also notice how the <code>,</code> is outside the semantic wiki tags. This is so the semantic value has only the name of the sensor, but not the comma between them as the comma is not an actual part of the name.</div>
As you can see, you can use all of the properties multiple times without any problems but before you do so, think about whether making multiple properties like this one actually make sense. Making multiple properties for multiple different sensors is logical and encouraged, but creating four different properties for the announcement date is nonsensical because there can be only one announcement date (unless there are some very special circumstances which should be explicitly written in the article).
[[Category:Guides]]

Navigation menu