Help:Section

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.

Pages can be divided into different sections by using headings. This helps to keep the page organized and uncluttered by sorting information into different labelled parts of the page. A page that contains four or more headings will automatically generate a table of contents that allows readers to quickly jump to a specific section.

Creating sections[edit source]

Sections can be created by adding headings using the following syntax.

You type You get
= Heading 1 =
== Heading 2 ==
=== Heading 3 ===
==== Heading 4 ====
===== Heading 5 =====
====== Heading 6 ======
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6

Do not use Level 1 headings as they are used in page titles. Section headings should usually follow a hierarchy, starting from a Level 2 heading and then gradually working their way down to lower heading levels for sub-sections.

Table of contents[edit source]

An example of a table of contents, shown on the Canada article on the English Wikipedia.

A table of contents, or TOC, is automatically generated when a page contains four or more headings. The table of contents is displayed just below the last paragraph of the very first part of the page, typically called the intro or "lede", or at the top of the page if there is no text in the intro. The table of contents will list all of the section headings on the page, numbered in sequential order, and will allow users to quickly jump to those sections when clicked. A table of contents is invaluable for navigation on a very long page.

The remainder of this section will describe different ways in which editors can manipulate and control the table of contents.

Hiding the table of contents[edit source]

In rare circumstances it may be desirable to hide the table of contents on a page (such as for a template). This can be accomplished by adding the __NOTOC__ magic word anywhere on the page, usually in the spot where the table of contents would normally appear. This prevents the table of contents from appearing on the current page, even if there are more than three headings. It is not necessary to use this magic word if there are less than four headings, and should typically not be used if the page cannot fit on one screen.

You can also achieve the opposite effect and force the table of contents to appear even if there are less than four headings by using the __FORCETOC__ magic word.

Positioning the table of contents[edit source]

By default, the table of contents appears just below the last line of the intro, or lede, of the page. You can specify where exactly the table of contents should appear by using the __TOC__ magic word where you want the table of contents to appear. This can be used to fix alignment or layout issues on certain pages, such as the table of contents appearing too low on the page. However, this should be used with caution; adding text after the table of contents but before the first heading can cause issues with accessibility.

Using __TOC__ will force the table of contents to appear even if there are less than four headings on the page. The main difference between it and __FORCETOC__ is that __TOC__ causes the table of contents to appear where the magic word was inserted, while __FORCETOC__ causes the table of contents to appear in its usual location.

Section linking[edit source]

Every heading, regardless of whether or not a table of contents exists on the page, produces an HTML "anchor" that can be linked to. When editing pages on The Sims Wiki, you can create a link to a section by typing [[name of page#section name]]. For example, to link to this section, type [[Help:Section#Section linking]]. When linking to this section from other sites, the URL would be www.thesimswiki.com/wiki/Help:Section#Section linking. You can link to a section on the current page by simply typing [[#section name]], without first having to enter the name of the page.

When a reader visits the link, they will be taken to the page in question and automatically brought to the linked section in question. If the linked section does not exist, the reader will still be taken to the page as normal, but will not be redirected to any particular section of the page.

If you add a heading to the page that contains only blank spaces, the heading will appear in the table of contents, but clicking on it will not take readers to the intended section. You should generally avoid creating headings with no content in them as this is generally bad form.

Linking to the table of contents[edit source]

The table of contents has a section name of toc, so you can link to it by typing [[name of page#toc]] or [[#toc]].

Creating a linkable section without using headings[edit source]

Sometimes, it may be desirable to create an anchor that you can link to without using a section heading, such as for tables where section headings cannot be used. On The Sims Wiki, this can be accomplished by using the {{Anchor}} template. Simply add {{Anchor|<name of section>}} where you want the target to point to. For example, if you add {{Anchor|Foo Bar}} to the page, you can link to it using [[name of page#Foo Bar]].

Sections created by {{Anchor}} do not appear in the table of contents, and will not affect the display of the page.

Section editing[edit source]

Each section, by default, will produce an "Edit" link adjacent to it that allows editors to edit only that section. When clicked, the editing window will only display the contents of that section and any applicable sub-sections. Section editing is useful on very long pages and can help reduce the likelihood of an edit conflict occurring.

When editing sections using this method, the edit summary field will be prefilled with /* section name */. These are automatically rendered as section links when you publish your edit. For example, test /* Foo */ test would be rendered as:

test - Foo: test

In cases where it may be necessary to disable these section edit links, you can add __NOEDITSECTION__ anywhere on the page to disable the links. It will not disable section editing itself; anyone can still edit sections if they know the exact URL to do so, or by editing the entire page.

New section link[edit source]

All talk pages will have an additional 'New section' link next to the 'Edit' button that allows them to quickly add a new section onto the bottom of the page. In this case, the edit summary box will be replaced with a 'Subject:' box that will be used in the Level 2 heading of the section. If this box is left empty, no new heading will be created. This is commonly used on discussion pages to create new discussion threads.

The 'New section' link is disabled by default on other pages, although it can be enabled by adding __NEWSECTIONLINK__ anywhere on the page. It is also possible to disable the link by adding __NONEWSECTIONLINK__ anywhere on the page.

Editing the lead section[edit source]

By default, there is no edit link to edit only the uppermost part, or the lead section, of a page; the entire page must be edited. You can fix this by going into your user preferences, going to "Gadgets", and then enabling "Add an [edit] link for the top section of a page".

Preview[edit source]

When you preview an edit while editing a section, you may not see the section as it actually appears on the full page. For example, if there is an image in the previous section that intrudes into the section you are editing, you will not see this image. The list of templates used on the page will show the list of all templates used on the page, not just the ones in the edited section. Additionally, if you are editing the "References" section of a page, which would contain <references /> or {{Reflist}} which would normally display all of the footnotes used on the page, footnotes used in previous sections will not be displayed.

If you preview a section that contains footnotes but does not contain <references /> or {{Reflist}}, those footnotes will still be previewed normally at the bottom of the preview window. In previous versions of MediaWiki, the footnotes would not be displayed and a cite error message would be displayed instead.

Subsections[edit source]

Subsections are included in the part of the section that is edited. For example, if you click on the "Edit" link next to a Level 2 heading, you will be able to edit everything under that heading, including lower-level headings, up until the next Level 2 heading on the page.

See also[edit source]