Help:List

From The Sims Wiki, a collaborative database for The Sims series
Jump to navigation Jump to search
Information.svg
This page is a help page
It is meant to detail processes or procedures of some aspect or aspects of The Sims Wiki's norms and practices. It is not a policy page.

Lists are a way of organizing and ordering data. This page will explain how to create and edit lists on The Sims Wiki.

List basics[edit source]

There are three types of lists: unordered lists, ordered lists, and definition lists (or description lists).

You type You get
* Lists are easy to do:
** start every line
* with a star
** more stars mean
*** deeper levels
  • Lists are easy to do:
    • start every line
  • with a star
    • more stars mean
      • deeper levels
* A newline
* in a list
marks the end of the list. Of course
* you can
* start again.
  • A newline
  • in a list

marks the end of the list. Of course

  • you can
  • start again.
# Numbered lists are good
## very organized
## easy to follow
  1. Numbered lists are good
    1. very organized
    2. easy to follow
Definition (description, association) lists:
; Term : Description
or
; Term
: Description
Can be used for more than terms and definitions ''per se''.
or
; Term
: Description Line 1
: Description Line 2

Definition (description, association) lists:

Term 
Description

or

Term
Description

Can be used for more than terms and definitions per se. or

Term
Description Line 1
Description Line 2
* Or create mixed lists
*# and nest them
*#* like this.
*#*; Fruits
*#*: Apple
*#*: Blueberry
  • Or create mixed lists
    1. and nest them
      • like this.
        Fruits
        Apple
        Blueberry
# A line break in an item is done with HTML<br />like this.
# Just breaking the line will accidentally end the list
like this.
# This was supposed to be item 3, not a new list.
  1. A line break in an item is done with HTML
    like this.
  2. Just breaking the line will accidentally end the list

like this.

  1. This was supposed to be item 3, not a new list.
* A new paragraph in an item is also HTML.<p>Like so.</p>
* Same goes for<blockquote>"block quotations"</blockquote>like that.
* Note that these are done without line-breaking the wikimarkup.
  • A new paragraph in an item is also HTML.

    Like so.

  • Same goes for

    "block quotations"

    like that.
  • Note that these are done without line-breaking the wikimarkup.

Common mistakes[edit source]

There must not be any blank lines between list items. A blank line terminates a list, and any list entries created afterwards will be considered to be part of a different list. This is most noticeable when using ordered lists and will affect the underlying HTML code, which may cause issues with some screen readers.

You type You get
# This is the first item.
# This is the second item.
# This is the third item.
# This is the fourth item.
  1. This is the first item.
  2. This is the second item.
  3. This is the third item.
  4. This is the fourth item.
# This is the first item.
# This is the second item.

# This is the third item.
# This is the fourth item.
  1. This is the first item.
  2. This is the second item.
  1. This is the third item.
  2. This is the fourth item.

In order to be a list, each line must begin the same way. Starting a line differently will cause it to be interpreted as a different list. This also affects the underlying HTML and may also cause issues with screen readers.

You type You get
# If you start with
# one type of list,
#; and then a sublist
#: of a different type,
#:* the list characters
# always go in order.
  1. If you start with
  2. one type of list,
    and then a sublist
    of a different type,
    • the list characters
  3. always go in order.
# If you reverse
# the order,
;# everything
:# gets
*:# thrown off
# and nothing matches up.
  1. If you reverse
  2. the order,
  1. everything
  2. gets
    1. thrown off
  1. and nothing matches up.

Don't use a semicolon to simply give a list (or anything else, for that matter) a title. Semicolons and colons make up one kind of list; asterisks and number signs make another. This will (again) affect the underlying HTML and causes issues with screen readers.

You type You get
;Never do
*this
Never do
  • this

Paragraphs and other breaks[edit source]

For simplicity, lists in wiki markup can't be longer than a paragraph. A single line break will end the list entry, and the entire list will be ended if the line doesn't start with the same character as the list. This is most noticeable with ordered lists, where the numbering will get reset if this happens. For unordered lists, the effect may not appear to be noticeable on-screen, but it will cause issues with screen readers and is bad for accessibility.

The best way to create paragraphs inside list items is to use the <p> ... </p> HTML tags, with no line breaks in the wiki markup.

You type You get
# Paragraph 1.<p>Paragraph 2.</p><p>Paragraph 3.</p>
# Second item.
  1. Paragraph 1.

    Paragraph 2.

    Paragraph 3.

  2. Second item.
# Do not
<p>Do this</p>
<p>It will</p>
# Not work
  1. Do not

Do this

It will

  1. Not work

If it would be useful to have line breaks, in the wiki markup of the page, such as if the paragraphs are very long, you can use HTML comments to accomplish this. The comments must start at the end of one line and end at the start of another.

You type You get
# Paragraph 1.<!--
 --><p>Paragraph 2.</p><!--
 --><p>Paragraph 3.</p>
# Second item.
  1. Paragraph 1.

    Paragraph 2.

    Paragraph 3.

  2. Second item.

For a single line break, you can use a single <br /> tag. This is useful where nested lists are not desired.

You type You get
# Get ingredients:<br />1 Apple<br />2 Bananas<br />1½ cups of sugar
# Add to blender and blend until smooth
  1. Get ingredients:
    1 Apple
    2 Bananas
    1½ cups of sugar
  2. Add to blender and blend until smooth

You can also add block quotations to lists without breaking them.

You type You get
* Beginning of first item.<blockquote>A large quotation.</blockquote>Rest of first item.<br /><br />
* Second item.
  • Beginning of first item.

    A large quotation.

    Rest of first item.

  • Second item.

Continuing a list item after a sub-item[edit source]

In HTML, a list item may contain several sublists, not necessarily adjacent; thus there may be parts of the list item not only before the first sublist, but also between sublists, and after the last one. However, in wiki markup, sublists follow the same rules as sections of a page: the only possible part of the list item not in sublists is before the first sublist.

In the case of an unnumbered first-level list in wikitext code this limitation can be overcome by splitting the list into multiple lists. Indented text between the partial lists may visually serve as part of a list item after a sublist. However, this may give, depending on CSS, a blank line before and after each list, in which case, for uniformity, every first-level list item could be made a separate list.

Numbered lists illustrate that what should look like one list may, for the software, consist of multiple lists; unnumbered lists give a corresponding result, except that the problem of restarting with 1 is not applicable.

You type You get
<ol>
  <li>list item A1
    <ol>
      <li>list item B1</li>
      <li>list item B2</li>
    </ol>continuing list item A1
  </li>
  <li>list item A2</li>
</ol>
  1. list item A1
    1. list item B1
    2. list item B2
    continuing list item A1
  2. list item A2
vs.
#list item A1
##list item B1
##list item B2
#:continuing list item A1
#list item A2
  1. list item A1
    1. list item B1
    2. list item B2
    continuing list item A1
  2. list item A2

Going one level deeper, with a sublist item continuing after a sub-sublist, will produce even more blank lines; however, the continuation of the first-level list is not affected:

You type You get
# list item A1
## list item B1
### list item C1
##: continuing list item B1
## list item B2
# list item A2
  1. list item A1
    1. list item B1
      1. list item C1
      continuing list item B1
    2. list item B2
  2. list item A2

Changing the list type[edit source]

The list type determines what kind of marker is used before the list item. It can be changed using the list-style-type CSS property.

You type You get
<ol style="list-style-type:lower-roman">
  <li>About the author</li>
  <li>Foreword to the first edition</li>
  <li>Foreword to the second edition</li>
</ol>
  1. About the author
  2. Foreword to the first edition
  3. Foreword to the second edition
<ol style="list-style-type:lower-alpha">
  <li>About the author</li>
  <li>Foreword to the first edition</li>
  <li>Foreword to the second edition</li>
</ol>
  1. About the author
  2. Foreword to the first edition
  3. Foreword to the second edition

Extra indentation of lists[edit source]

Lists are indented by 3.2em by default. In a numbered list in a large font, some browsers do not show more than two digits of indentation unless extra indentation is applied (if there are multiple columns, for each column). This can be fixed by increasing the indentation an additional 2em.

The easiest way to do this is to add <ol> ... </ol> or <ul> ... </ul> tags around wiki markup list items. The parser translates a list without any list items into a <div style="margin-left: 2em;", which causes indentation. This is good for most cases, but it doesn't allow you to start an ordered list with a number other than 1.

You type You get
<ol>
# abc
# def
# ghi
</ol>
    1. abc
    2. def
    3. ghi
<ul>
#abc
#def
#ghi
</ul>
    1. abc
    2. def
    3. ghi

The best way to create an indented list is to use full HTML instead of wiki markup. Although not the easiest, it works well for both basic and complex lists; doesn't produce invalid HTML; and allows ordered lists to start with a number other than 1.

You type You get
<ol style="margin-left: 5.2em;">
  <li>abc</li>
  <li>def</li>
  <li>ghi</li>
</ol>
  1. abc
  2. def
  3. ghi

Avoid using definition lists for indenting other lists. This technique works in a hurry, but produces poorly formed HTML and causes accessibility issues.

You type You get
:# abc
:# def
:# ghi
  1. abc
  2. def
  3. ghi

Specifying a starting value[edit source]

You can have an ordered list start on a different number other than 1. This can be accomplished using HTML. Only the list item whose value is being changed needs to use HTML; the rest can use regular wiki markup.

You type You get
# <li value="9">Amsterdam</li>
# Rotterdam
# The Hague
  1. Amsterdam
  2. Rotterdam
  3. The Hague

Alternatively, you can use all HTML for the list.

You type You get
<ol start="9">
<li>Amsterdam</li>
<li>Rotterdam</li>
<li>The Hague</li>
</ol>
  1. Amsterdam
  2. Rotterdam
  3. The Hague
<ol>
<li value="9">Amsterdam</li>
<li value="8">Rotterdam</li>
<li value="7">The Hague</li>
</ol>
  1. Amsterdam
  2. Rotterdam
  3. The Hague

Multi-column lists[edit source]

You can use the {{Columns-list}} to add columns to a list.

You type You get
{{columns-list|colwidth=10em|
* apple
* carpet
* geography
* mountain
* nowhere
* postage
* ragged
* toast
}}
  • apple
  • carpet
  • geography
  • mountain
  • nowhere
  • postage
  • ragged
  • toast
{{columns-list|colwidth=10em|
# apple
# carpet
# geography
# mountain
# nowhere
# postage
# ragged
# toast
}}
  1. apple
  2. carpet
  3. geography
  4. mountain
  5. nowhere
  6. postage
  7. ragged
  8. toast

This is the general solution. Other solutions that also work include using the {{Col-begin}}, {{Col-break}}, and {{Col-end}} templates...

You type You get
{{Col-begin}}
{{Col-break}}
* apple
* carpet
* geography
* mountain
{{Col-break}}
* nowhere
* postage
* ragged
* toast
{{Col-end}}
  • apple
  • carpet
  • geography
  • mountain
  • nowhere
  • postage
  • ragged
  • toast

...or using HTML.

You type You get
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
* apple
* carpet
* geography
* mountain
* nowhere
* postage
* ragged
* toast
</div>
  • apple
  • carpet
  • geography
  • mountain
  • nowhere
  • postage
  • ragged
  • toast
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* apple
* carpet
* geography
* mountain
* nowhere
* postage
* ragged
* toast
</div>
  • apple
  • carpet
  • geography
  • mountain
  • nowhere
  • postage
  • ragged
  • toast

Tables[edit source]

A one-column table is very similar to a list, but it allows sorting. If the wiki markup itself is already sorted with the same sortkey, this advantage does not apply. A multiple-column table allows sorting on any column.

You type You get
{|
|Apple
|-
|Orange
|-
|Bread
|-
|Butter
|-
|Ice cream
|}
Apple
Orange
Bread
Butter
Ice cream
{| class="wikitable sortable"
|-
! Groceries
|-
|Apple
|-
|Orange
|-
|Bread
|-
|Butter
|-
|Ice cream
|}
Groceries
Apple
Orange
Bread
Butter
Ice cream

See also[edit source]