GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing www.mediawiki.org — Help:Section - MediaWiki
The section header syntax allows a page to be divided into sections. Section creation and numberingTo create a section, define its headings as follows: ==Section== ===Subsection=== ====Sub-subsection==== Guidelines for using section headers
Table of contents (TOC)This feature is not supported in skins that display a table of contents outside the article content, such as the Vector 2022 skin. In the Vector 2022 skin, a TOC is generated even with only one section heading.
A table of contents (TOC) is automatically generated for pages containing more than three section headings.
However, editors may choose to exclude the TOC by adding the magic word Guidelines for using table of contents
Summary:
Moving the table of contentsThe code below allows the Table of Contents to be positioned as a floating table on the right side of the screen. {| align="right" | __TOC__ |}
Limiting the TOC depth globallyYou can control the depth of the Table of Contents (TOC) by adjusting the $wgMaxTocLevel setting in the Linking to a sectionSection headers will automatically generate HTML with the For instance, the HTML code that was created at the start of this section on the English version of this page is: <h2><span class="mw-headline" id="Linking_to_a_section">Linking to a section</span></h2> A link to this (section) appears as: [[Help:Section#Linking to a section|Section linking]] You can link to a section within a page using A link to a subsection, sub-subsection, etc. will be Duplicate section names are denoted by appending an underscore and a number. For instance, if there are three sections named "Example", they will be labeled "Example", "Example_2", and "Example_3". However, when editing sections "Example_2" or "Example_3", the edit summary confusingly directs to "Example". A blank heading in a section distorts the Table of Contents (TOC). Linking sections using an arbitrary idSection link anchors can change without notice, especially when an article contains multiple sections with the same name.
Additional identifiers like " 2", " 3", etc., are added to distinguish these sections.
If a section is added, deleted, or renamed, it may alter the link's destination, potentially leading to incorrect or non-existent sections.
This can be avoided using the HTML <span id="anchor_name"></span> Please ensure that the chosen name is unique by incorporating abbreviated titles from higher-level sections, such as <span id="Ontario-Natural features">(optional text)</span> [will not work] <span id="Newfoundland-Natural_features">(optional text)</span> [will work] ... See [[#Ontario-Natural features|natural features of Ontario]] and [[#Newfoundland-Natural features|natural features of Newfoundland]] Replace spaces in the id with underscores to ensure links work seamlessly with both underscores and spaces.
See manual anchors for linking to any section on a page. Linking sections and redirectsLinking to a specific section of a page through a redirect usually functions similarly to linking directly to that section. Renaming a page generates a redirect, but renaming a section does not. Additionally, there is no distinct backlink feature for sections ; pages linking to a section are listed among pages linking to the entire page. To address these issues:
Redirect pages can be put into categories by adding a category tag after the redirect command. If the redirect leads to a section, it somewhat categorizes that section too. However, the section will not link back to the category unless specifically done. On category pages, redirects are shown in italics. For more details, check out w:Wikipedia:Categorizing redirects.
Editing sectionsTo edit specific sections of a page, you can click on the https://www.mediawiki.org/w/index.php?title=Help:Advanced_editing&action=edit§ion=9 Instead of using section titles, section editing uses section numbers.
Subsections are represented with a single number (e.g., In the link above, section 2 in the table of content is numbered as 9 in the link.
This allows for focused editing without the need to have the entire text of the page visible.
It is particularly useful for large pages, as it simplifies the editing process and reduces clutter.
Adding When inserting a section, edit the previous or following section, merge by deleting the heading if necessary, and adjust the edit summary accordingly. Including a section at the endTo add a new section at the end of a page, you can use a URL like the following:
On talk pages and pages with wikitext, you can use the code If the subject box is left blank, no empty
The preload can be edited before it is saved. Editing before a first sectionGenerally, there is no designated link for editing the introductory text before the first section heading (phab:T2156). However, you can apply the section editing feature to this part by using 0 as the section number in the link, like this:
Alternatively, you can modify any section edit link on the page by changing the section number. To generate the same URL using JavaScript, see w:Wikipedia:WikiProject User scripts/Scripts/Edit Top. See Help:Section editing demo . PreviewSection editing preview may differ from the full page if an image from a previous section overlaps with the current section. The edit page displays all templates used on the entire page, including those from other sections. Working with subsectionsWhen editing a section, subsections are included and numbered relative to the edited part, starting at 1. Subsections are denoted with numbers like 1.1, 1.2, etc. The heading format follows the absolute level, with sub-subsections numbered accordingly. For example, a sub-subsection 3.2 would be numbered 3.2.1, 3.2.2 Editing a page with large sectionsIf a page has large sections or lacks division into sections, users can still modify the content by:
Editing sections of included templatesThis section (transcluded from Help:Section/Editing sections of included templates ) shows how it works.
For further information, see Transclusion .
You can edit sections within included pages or templates. Clicking the edit link for a section takes you to the edit page of the separate page. This is also known as Transclusion . The size of the section within the included page or template is determined by the headings in the main page where it is included. When a page is transcluded, all the text on the source page will be transcluded/included in the target page. This includes text placed before the first section heading on the source page. Consequently, if the edit link on the first section header of the transcluded text is clicked on the source page, section editing will open and the text before the first section header and the text of the next section will not be shown in the editor. In order to edit the entire source page's text, the editor must exit the editor when taken to the source page, and then click the edit link at the top of the source page. Similarly, if there are texts after the template tag without a heading, you need to click the headings before the template to edit it. This section shows how it works. To ensure clarity and consistency in rendered source pages that are transcluded to another page, follow these guidelines:
Additionally, consider the following practices for managing templates effectively:
For example, think of a template structured as follows: == Template heading 1 == Content === Template heading 2 === Content To prevent "edit section" links from appearing when transcluding a template, add <h2>Template heading 1</h2> Content <h3>Template heading 2</h3> Content Sections within a parser functionWhen conditionally transcluding a template with sections using a parser function , the edit links for these sections may direct to the wrong section or show an error message claiming the section does not exist. This occurs because the content of conditionally included templates is considered part of the page itself, causing the sections to be counted after expansion. As a result, the edit links for sections within the included template link to the page instead of the template, and the subsequent edit links refer to the correct page but with incorrect section numbers. This issue does not arise when transcluding a template with a conditional name, which offers additional advantages. Editing footnotesTo edit a footnote in a section using Viewing a sectionYou can use the section editing feature to view a specific section without loading the entire page. Sections vs. separate pages vs. transclusionHere are some advantages of each of them: Advantages of one large page with sections:
Advantages of separate pages:
Advantages of compound documents by Transclusion :
Disadvantages:
Sections and Table of Content (ToC)Adding Non-Section Text to TOCYou can mark text as a TOC entry by using {| class="collapsible collapsed" style="text-align:left; border:0px; margin-top:0.2em"
|-
! style="background-color:#f2dfce" | <h4>Stuff</h4>
|-
| Contents about stuff here
|}
{| class="collapsible collapsed" style="text-align:left; border:0px; margin-top:0.2em"
|-
! style="background-color:#f2dfce; padding-top:0; padding-bottom:0" |
<h4 style="margin:0; padding:0;font-size:95%">More stuff</h4>
|-
| Contents about more stuff here
|}
To clarify, you want the collapse boxes headers treated as section titles, included in the table of contents (TOC), without necessitating formal "section titles" on the page itself. Although not recommended, it is possible to create a TOC entry that is not in the text but acts as an anchor for linking to a section header with slightly different wording: <h4 style="display:none">Your heading here</h4> Sections for the above demoDemo abcThis section is linked to from #Linking to a section. See alsoNotes | |||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |