手册:移除标签

From mediawiki.org
This page is a translated version of the page Manual:Removing tabs and the translation is 15% complete.
Outdated translations are marked like this.
See also Manual:界面/侧边栏 to remove the links in the sidebar.

将可以把以下代码添加到MediaWiki:Common.css来删除MediaWiki上的选项卡。

移除标签

Add the following code to MediaWiki:Common.css to remove corresponding tabs:

代码 解释
#ca-nstab-main { display: none !important; } Page tab
#ca-nstab-user { display: none !important; } User page tab (the Page tab on personal user pages)
#ca-talk { display: none !important; } Discussion tab
#ca-view { display: none !important; } Read tab (from the prepackaged skins this tab is available only in the Vector skin)
#ca-edit { display: none !important; } Edit tab. Edit source when Visual Editor is installed.
#ca-ve-edit { display: none !important; } Edit tab when Visual Editor is installed.
#ca-formedit { display: none !important; } Edit with Form tab when Page Forms are installed.
#ca-history { display: none !important;} View history/History tab
#ca-watch { display: none !important; } the Watch tab for adding the page to the watchlist
#ca-unwatch { display: none !important; } the Unwatch tab for removing the page from the watchlist
#ca-delete { display: none !important; } Delete tab (in the Vector skins it's displayed with the More drop-down menu)
#ca-move { display: none !important; } Move tab (in the Vector skin it's part of the More drop-down menu)
#ca-protect { display: none !important; } Protect tab (as the previous two, with the Vector skin it's in the More drop-down menu)
#ca-viewsource { display: none !important; } View source tab; this tab is available for users who belong to user groups that don't have the permission to edit pages. With it the user can view the source text of the page without being able to modify it.

Remove Tabs from Specific Pages

It is possible to remove a tab only from a particular page(s) of your choice.

For example, the following:

body.page-Main_Page li#ca-delete { display: none !important; }

will hide the Delete tab on the Main Page.

You only have to replace the ID of the tab and the name of the page. In the above example the ID of the tab is #ca-delete and the name of the page Main_Page.

So, for example, if you want to remove the Discussion tab on a page with the name "Example Page", use this code:

body.page-Example_Page li#ca-talk { display: none !important; }

If the name of the page consists of more than one word, put underscores (_) between the words.

Lines between tabs

In the Vector skin, the light blue fading lines between tabs is called the div.vectorTabs span. The light blue fading lines on the sides are left-navigation and right-navigation.

请参见此帮助页面主题以获取更多信息

参见

Topic on Project:Support desk: