Extension:Header Tabs/ru
Header Tabs Статус релиза: стабильно |
|
---|---|
Реализация | Функция парсера , Пользовательский интерфейс |
Описание | Displays top-level headers as JavaScript-based tabs |
Автор(ы) | |
Последняя версия | 2.3 (октябрь 2024) |
Политика совместимости | Мастер поддерживает обратную совместимость. |
MediaWiki | 1.33+ |
Лицензия | GNU General Public License 2.0 или позднее |
Скачать | Version history |
|
|
Переведите расширение Header Tabs, если оно доступно на translatewiki.net | |
Проблемы | Открытые задачи · Сообщить об ошибке |
The Header Tabs extension transforms top-level MediaWiki headers (i.e., headers surrounded by a single "=") into JavaScript-based tabs.
Использование
To enable tabs on a page after you installed the extension, you need to add a <headertabs />
tag into the page in place where the last tab should end (everything below this tag will be shown under the tab view).
Most of the time, though, you'll want to put it at the bottom of the page.
In addition to that, the page should have top-level headers defined in it like this:
= Header title =
Each such top-level header, if it's anywhere above the <headertabs />
tag, will be displayed as a tab.
Linking to tabs
You can link to a tab, both from another page and from within that same page (and, within that same page, both from another tab and from outside the tab view).
This is done using the {{#switchtablink}}
parser function, which is called like this:
{{#switchtablink:Tab name|Текст ссылки|Название страницы}}
This will create a link to the tab with the name "Tab name", and the text of the link will read "Link text". If you want the link to a point to a tab on another page, you can optionally add the third parameter, "Page name".
Пример
Some text above the tab view = Первый заголовок раздела = This will be displayed on the first tab {{#switchtablink:Второй заголовок раздела|Click here to go to the next tab...}} = Второй заголовок раздела = This will be displayed on the second tab <headertabs/> = Третий заголовок раздела = This will be always displayed under the tab view because it's below the <headertabs/> tag.
The header titles get automatically converted into tab titles.
Загрузка
You can download the Header Tabs code, in .zip format: https://github.com/wikimedia/mediawiki-extensions-HeaderTabs/archive/2.3.zip
You can also download the code directly via Git from the MediaWiki source code repository. From a command line, call the following:
git clone https://phabricator.wikimedia.org/diffusion/EHET/extension-headertabs.git
To view the code online, including the version history for each file: https://phabricator.wikimedia.org/diffusion/EHET/browse/master/
Установка
- Скачайте и распакуйте файл(ы) в папку с названием
HeaderTabs
в вашей папкеextensions/
.
Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/HeaderTabs - Добавьте следующий код в конце вашего файла LocalSettings.php :
wfLoadExtension( 'HeaderTabs' );
- Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.
Modifications
Skin modification
To change the tabs' styling, see "Skin modification".
Configuration parameters
The following parameters can be modified in LocalSettings.php below the call to wfLoadExtension()
.
$wgHeaderTabsRenderSingleTab
The $wgHeaderTabsRenderSingleTab
variable defines if Header Tabs will activate if only a single top-level header is found.
By default this variable is set to false, i.e. no tabs will be shown if only one top-level header is found.
You can enable this behaviour by adding the following:
$wgHeaderTabsRenderSingleTab = true;
$wgHeaderTabsAutomaticNamespaces
The $wgHeaderTabsAutomaticNamespaces
variable defines the set of namespaces for which you don't need to add the <headertabs />
tag in order to enable tabs.
If a namespace ID is defined in this variable, header tabs will activate automatically when you have two top-level headers (or one, if you have $wgHeaderTabsRenderSingleTab
set to true) in an article.
By default this variable holds no namespaces.
You can add namespaces to this list by adding the following for each namespace:
$wgHeaderTabsAutomaticNamespaces[] = NS_MAIN;
$wgHeaderTabsDefaultFirstTab
The $wgHeaderTabsDefaultFirstTab
variable defines whether Header Tabs puts any content before the first defined header and put it into its own tab.
By default this variable is set to false
.
You can enable this behavior by adding the default name using the following:
$wgHeaderTabsDefaultFirstTab = 'DefaultTabName';
If using this setting, be careful not to enable $wgHeaderTabsRenderSingleTab
as it will lead to tabs appearing in other parts of the UI.
$wgHeaderTabsNoTabsInToc
If you want the page to have a TOC, but do not want to include the tab names in that TOC, add the following to LocalSettings.php:
$wgHeaderTabsNoTabsInToc = true;
If, however, you only want to keep the tabs out of the TOC in some but not all pages, you can instead add the following to the top of any such pages:
<notabtoc/>
$wgHeaderTabsEditTabLink
The $wgHeaderTabsEditTabLink
variable defines if Header Tabs will add a edit link to the right of the tabs which let you edit only the tabs' text.
By default this variable is set to true, i.e. a edit link for the tab will be shown.
You can disable this behavior by adding the following:
$wgHeaderTabsEditTabLink = false;
История версий
To see a list of changes for each version, see version history. For a list of features planned for future releases, please see roadmap.
Известные ограничения и проблемы
- You cannot use the tag more than once. In other words, a second tag will not produce a second series of tabs.
- Tabs render on top of infoboxes in Chrome.
- Header Tabs will not work with the HTML Tidy tool, i.e. if $wgTidyConfig is populated.
Sections appearing outside the tabbed section
Header Tabs sections which include floated objects (such as infoboxes) may appear outside the tabs container if other content does not force the container to be large enough to hold the floated object. One resolution to this problem is to place a cleared html element at the very end of each section.
A simple, but not best-practice, means of doing this is:
<div style="clear:both"></div>
This forces this element to be considered by the browser after your floated object and thus will grow the container to fit both.
Поддержка
The best way to seek help with this extension is to send questions to the mediawiki-l mailing list. The extension maintainers, and active users and contributors, are on this list and will be able to help you.
Contributing to the project
Bugs and feature requests
There are a number of ways to get support for Header Tabs, including questions, suggestions, bug reports and feature requests:
- Place questions on the discussion page for Header Tabs.
- You can submit bug reports and feature requests at MediaWiki's Phabricator site, here; enter "Header Tabs" in the "Tags" field. (The current list of known bugs and requested features for Header Tabs can be found here.)
- Use the main MediaWiki mailing list, mediawiki-l.
Contributing patches to the project
If you found some bug and fixed it, or if you wrote code for a new feature, please either do a Git commit for it, or create a patch by going to the "HeaderTabs
" directory, and typing:
git diff > descriptivename.patch
If you create a patch, please send it, with a description, to Yaron Koren.
Translating
Translation of Header Tabs is done through translatewiki.net. The translation for this extension can be found here: https://translatewiki.net/wiki/Special:Translate?group=ext-headertabs. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.
См. также
Это расширение включено в следующие вики-фермы/хостинги и/или пакеты: Это не исчерпывающий список. Некоторые вики-фермы/хостинги и/или пакеты могут содержать это расширение, даже если они не перечислены здесь. Всегда сверяйтесь со своими вики-фермами/хостингами или комплектами/бандлами для подтверждения. |
- Stable extensions/ru
- Parser function extensions/ru
- User interface extensions/ru
- GPL licensed extensions/ru
- Extensions in Wikimedia version control/ru
- EditPageGetDiffContent extensions/ru
- EditPageGetPreviewContent extensions/ru
- ParserAfterTidy extensions/ru
- ParserFirstCallInit extensions/ru
- ResourceLoaderGetConfigVars extensions/ru
- All extensions/ru
- Extensions included in BlueSpice/ru
- Extensions included in Canasta/ru
- Extensions included in Miraheze/ru
- Extensions included in MyWikis/ru
- Extensions included in ProWiki/ru
- Extensions included in WikiForge/ru