Extension:TocTree: Difference between revisions
Appearance
Content deleted Content added
mNo edit summary |
m 26 revisions imported: Import history from "TocTree extension" in https://archive.org/details/wiki-wikivoyage_oldorg_w_tech |
||
| (18 intermediate revisions by 12 users not shown) | |||
| Line 1: | Line 1: | ||
<languages/> |
|||
{{TNT|Extension|templatemode = |
|||
{{Extension |
|||
|name = TocTree |
|name = TocTree |
||
|status = |
|status = stable |
||
|type1 = interface |
|type1 = interface |
||
|type2 = |
|type2 = |
||
|hook1 = BeforePageDisplay |
|||
|hook2 = GetPreferences |
|||
|username = |
|username = |
||
|author = |
|author = |
||
|description = <translate><!--T:1--> Allows for expansion and collapsing of the table of contents</translate> |
|||
|description = |
|||
|image = |
|||
|imagesize = |
|||
|version = |
|||
|update = |
|||
|mediawiki = 1.20 |
|||
|php = |
|||
|license = GPL-2.0+ |
|||
| ⚫ | |||
|needs-updatephp = no |
|||
|readme = |
|||
|changelog = |
|changelog = |
||
|parameters = |
|parameters = |
||
| Line 25: | Line 14: | ||
|example = |
|example = |
||
|compatibility = |
|compatibility = |
||
| ⚫ | |||
|phabricator = MediaWiki-extensions-TocTree |
|phabricator = MediaWiki-extensions-TocTree |
||
}} |
}} |
||
<translate> |
|||
<!--T:6--> |
|||
The <tvar name=1>'''TocTree'''</tvar> extension allows for initial expansion and collapsing of the table of contents. |
|||
==Installation== |
==Installation== <!--T:2--> |
||
</translate> |
|||
{{ |
{{ExtensionInstall |
||
|TocTree |
|||
|registration=required |
|||
}} |
|||
<translate> |
|||
== Customization == |
== Customization == <!--T:3--> |
||
<!--T:7--> |
|||
The PHP script will add two new options to the user preferences. They were added to the Misc section: |
The PHP script will add two new options to the user preferences. They were added to the Misc section: |
||
</translate> |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
<translate><!--T:10--> Defaults are collapsed but not floated tocs.</translate> |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
$wgDefaultUserOptions['toc-floated'] = false; |
$wgDefaultUserOptions['toc-floated'] = false; |
||
$wgDefaultUserOptions['toc-expand'] = false; |
$wgDefaultUserOptions['toc-expand'] = false; |
||
</syntaxhighlight> |
|||
</source> |
|||
| ⚫ | |||
<translate> |
|||
| ⚫ | |||
</translate> |
|||
The author has the opportunity to prevent floating of the TOC set by the user(s) by using a <code>div</code> tag with the style class <code>noFloat</code> enclosing the TOC. |
The author has the opportunity to prevent floating of the TOC set by the user(s) by using a <code>div</code> tag with the style class <code>noFloat</code> enclosing the TOC. |
||
| Line 52: | Line 55: | ||
</pre> |
</pre> |
||
<translate> |
|||
== Known Problems == |
|||
== Known problems == <!--T:5--> |
|||
<!--T:11--> |
|||
There are the well-known problems of floated boxes like: |
There are the well-known problems of floated boxes like: |
||
</translate> |
|||
* <translate><!--T:12--> Missing list bullets</translate> |
|||
* Missing list bullets, see for instance [http://css-discuss.incutio.com/?page=MissingBulletPoints Missing Bullet Points] |
|||
* Design problems of narrow TOCs and positioning problems with text and wide right-floated boxes. |
* <translate><!--T:13--> Design problems of narrow TOCs and positioning problems with text and wide right-floated boxes.</translate> |
||
<translate> |
|||
<!--T:14--> |
|||
Additional: |
Additional: |
||
</translate> |
|||
* Bidi support (right-to-left writing direction) implemented but not yet tested (for instance needed for Hebrew and Arabic). |
* <translate><!--T:15--> Bidi support (right-to-left writing direction) implemented but not yet tested (for instance needed for Hebrew and Arabic).</translate> |
||
* |
* <translate><!--T:16--> Support of only the MonoBook and Vector skins.</translate> |
||
| ⚫ | |||
== Feedback == |
|||
{{Used by}} |
|||
See [https://phabricator.wikimedia.org/tag/mediawiki-extensions-toctree/ TocTree tasks on Phabricator]. |
|||
[[Category:TOC extensions{{#translation:}}]] |
|||
| ⚫ | |||
Latest revision as of 17:36, 10 May 2025
Release status: stable |
|
|---|---|
| Implementation | User interface |
| Description | Allows for expansion and collapsing of the table of contents |
| Author(s) | Roland Unger, Matthias Mullie |
| Latest version | 1.12.0 |
| MediaWiki | >= 1.47.0 |
| Licence | GNU General Public License 2.0 or later |
| Download | |
| Translate the TocTree extension if it is available at translatewiki.net | |
| Issues | Open tasks · Report a bug |
The TocTree extension allows for initial expansion and collapsing of the table of contents.
Installation
[edit | edit source]- Download and move the extracted
TocTreefolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TocTree
- Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'TocTree' );
Done – Navigate to Special:Versionon your wiki to verify that the extension is successfully installed.
Customization
[edit | edit source]The PHP script will add two new options to the user preferences. They were added to the Misc section:
- Floated table of contents
- Expand table of contents
Defaults are collapsed but not floated tocs. You can overwrite the default values by setting true in your LocalSettings.php file:
$wgDefaultUserOptions['toc-floated'] = false;
$wgDefaultUserOptions['toc-expand'] = false;
Prevention of TOC floating
[edit | edit source]The author has the opportunity to prevent floating of the TOC set by the user(s) by using a div tag with the style class noFloat enclosing the TOC.
<div class="noFloat">__TOC__</div>
Known problems
[edit | edit source]There are the well-known problems of floated boxes like:
- Missing list bullets
- Design problems of narrow TOCs and positioning problems with text and wide right-floated boxes.
Additional:
- Bidi support (right-to-left writing direction) implemented but not yet tested (for instance needed for Hebrew and Arabic).
- Support of only the MonoBook and Vector skins.
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
| This extension is included in the following wiki farms/hosts and/or packages: |
Categories:
- Stable extensions
- User interface extensions
- ApiParseMakeOutputPage extensions
- BeforePageDisplay extensions
- GetPreferences extensions
- GPL licensed extensions
- Extensions in Wikimedia version control
- All extensions
- Extensions used on Wikimedia
- Extensions included in Miraheze
- Extensions included in MyWikis
- TOC extensions
