Extension:DynamicTabs

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
DynamicTabs

Release status:Extension status experimental

ImplementationTemplate:Extension#type MyWiki
DescriptionTemplate:Extension#description Remove or add custom tabs either to articles with the same name in a different namespace or other internal and external links
Author(s)Template:Extension#username Micke Nordin, David Öhlin (Micketalk)
Latest versionTemplate:Extension#version 0.5.3 (2009-10-03)
MediaWikiTemplate:Extension#mediawiki 1.15+
LicenseTemplate:Extension#license GNU General Public License 3.0
Download DynamicTabs-0.5.3.tar.gz DynamicTabs-0.5.3.zip
Hooks usedTemplate:Extension#hook
SkinTemplateContentActionsManual:Hooks/SkinTemplateContentActions

Translate the DynamicTabs extension if it is available at translatewiki.net

Check usage and version matrix.
This extension is unmaintained. If you want to take over email me at mickewiki at gmail period com
This extension only works with MediaWiki 1.15.0 or later.[1]

DynamicTabs extension removes or adds custom tabs (tabs such as the edit button, history button,etc). You can use this extension if you would like to hide tabs from users in a better way than CSS can. You can also use it to add new tabs either based on namespaces, internal links or external links.

All default tabs can be removed.

Download instructions[edit]

svn[edit]

You can download the latest version of the code from svn with the command: svn checkout http://micke.googlecode.com/svn/DynamicTabs DynamicTabs

Make sure you issue this command from the directory $IP/extensions/.

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Archive[edit]

Download the code tar.gzzip, unpack the archive and place the folder named DynamicTabs in $IP/extensions/.

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation[edit]

To install this extension, add the following to LocalSettings.php:

#DynamicTabs extension
require_once("$IP/extensions/DynamicTabs/DynamicTabs.php");

Configuration[edit]

All of the extension configuration is done on your wiki on the page Mediawiki:DynamicTabs.[2]

On this page you can create six different configuration sections:

  • hideAnonymous - tabs are hidden from anonymous users
  • hideUsers - tabs are hidden from registered users
  • hideSysop - tabs are hidden from administrators (sysops)
  • nsTabs
  • intLinks
  • extLinks

On Mediawiki:DynamicTabs:

  1. Section headers are denoted by a star (*)
  2. tabs are denoted by # followed by the name of the tab.

If you want a tab to be hidden from anonymous users, registered users AND sysops, you have to hide the tab from each of the groups separately.[3][4]

These are the sections and possible options:

*hideAnonymous[edit]

This section lists tabs that can be hidden from anonymous users. Including:

#nstab-main tab for main namespace
#nstab-mediawiki tab for mediawiki namespace
#nstab-project tab for project namespace
#nstab-user tab for user namespace
#nstab-image tab for file namespace
#nstab-template tab for template namespace
#nstab-category tab for category namespace
#nstab-custom_namespace_here tab for any custom namespace you have created
#talk tab for talkpages
#viewsource edit tab for anonymous users
#edit edit tab for registered users
#history history tabs

*hideUsers[edit]

hideUsers lists tabs that can be hidden from registered users. Including:

#nstab-main tab for main namespace
#nstab-mediawiki tab for mediawiki namespace
#nstab-project tab for project namespace
#nstab-user tab for user namespace
#nstab-image tab for file namespace
#nstab-template tab for template namespace
#nstab-category tab for category namespace
#nstab-custom_namespace_here tab for any custom namespace you have created
#talk tab for talkpages
#viewsource edit tab for anonymous users
#edit edit tab for registered users
#history history tabs
#move move tab
#watch watch tab
#addsection new section/+

*hideSysop[edit]

hideSysop lists tabs that can be hidden from sysop. Including:

#nstab-main tab for main namespace
#nstab-mediawiki tab for mediawiki namespace
#nstab-project tab for project namespace
#nstab-user tab for user namespace
#nstab-image tab for file namespace
#nstab-template tab for template namespace
#nstab-category tab for category namespace
#nstab-custom_namespace_here tab for any custom namespace you have created
#talk tab for talkpages
#edit tab edit tab
#history tab history tabs
#move tab move tab
#protect tab protection tab
#delete tab delete tab
#watch tab watch tab
#addsection tab new section/+

* nsTabs[edit]

nsTabs allows you to add links to the same page in a specified namespace, similar to how the discussion tab works.

If you have a custom namespace called for example "Help" where users can ask questions related to the topic of an article, rather than discuss how to write the article itself (which is what the talk page is for), you can do this:

#Help adds a link to the corresponding page in help-namespace to every page.

The name of the namespace must be specified with uppercase on the first letter.

* intLinks[edit]

intLinks hold internal static links to pages on the wiki, for example:

#[[Main_page|Main]]
#[[A page]]
#Main_page|Main
#A page

* extLinks[edit]

extLinks holds external static links to pages off-wiki;

for example:

#[http://mediawiki.org] will display http://mediawiki.org as link text
#[http://en.wikipedia.org wikipedia] will display wikipedia as link text
#http://google.com will display http://google.com as link text
#http://xkcd.com xkcd will display xkcd as link text

Example[edit]

For example your Mediawiki:DynamicTabs could look like this:

*hideUser
#viewsource
#edit
#talk
#history
#watch
#nstab-main
*hideSysop
#talk
#nstab-main
*nsTabs
#help
*intLinks
#[[Main page|main]]
*extLinks
#[http://www.google.com google]

Known Issues[edit]

This extension does not work with the new Vector skin, this is due to the way tabs are added in the vector skin which is different from almost all other skins. Fixing this is not trivial and patches would be appreciated. See bug report for this issue.

Register bugs[edit]

An issue tracker for this extension is located at Google code. Please do not use the talk page to report new bugs.

Notes[edit]

  1. If you have an older version of MediaWiki installed, you can use version 0.1 of the extension, which does not feature the web interface. Instead you have to use a file on the server for configuration.
  2. If this page doesn't exist the extension will do nothing.
  3. This is because you might want to have certain tabs hidden from sysops, but not from anonymous users or registered users.
  4. Note: The last version of this extension changes the behavior with regards to anonymous users and logged-in users. Previously tabs were hidden from anonymous users when specified under *hideUsers. This is no longer the case. You now have to hide tabs from the two groups separately.

See also[edit]

External links[edit]