PHPackages                             mwstake/mediawiki-component-generictaghandler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mwstake/mediawiki-component-generictaghandler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mwstake/mediawiki-component-generictaghandler
=============================================

Provides a generic tag handler interface for MediaWiki

1.0.4(3mo ago)06.2k↑47.4%1[2 PRs](https://github.com/hallowelt/mwstake-mediawiki-component-generictaghandler/pulls)GPL-3.0-onlyPHPCI passing

Since May 20Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/hallowelt/mwstake-mediawiki-component-generictaghandler)[ Packagist](https://packagist.org/packages/mwstake/mediawiki-component-generictaghandler)[ RSS](/packages/mwstake-mediawiki-component-generictaghandler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (13)Used By (0)

GenericTagHandler for MediaWiki
===============================

[](#generictaghandler-for-mediawiki)

Register tags
-------------

[](#register-tags)

Tag definition
--------------

[](#tag-definition)

Implement an instance of `MWStake\MediaWiki\Component\GenericTagHandler\ITag` interface and register it:

```
// By global
$GLOBALS['mwsgGenericTagRegistry'] = [
    'class' => 'MyClass',
    'services' => [ '...' ]
];

// By hook
$wgHooks['MWStakeGenericTagHandlerInitTags'][] = function ( &$tags ) {
    $tags[] = new MyTag(...);
};

// By registry
$registry = \MediaWiki\MediaWikiServices::getInstance()->getService( 'MWStake.GenericTagHandler.TagFactory' );
$registry->register( new MyTag( ... ) );
```

VisualEditor integration (over VisualEditorPlus)
------------------------------------------------

[](#visualeditor-integration-over-visualeditorplus)

You can return a `MWStake\MediaWiki\Component\GenericTagHandler\ClientTagSpecification` from your tag implementation to automatically register a tag in VisualEditor.

### Without a custom form

[](#without-a-custom-form)

Pass `null` to `$formSpecification` param to let the default form be used.

### With server-side-defined form

[](#with-server-side-defined-form)

Pass a `MWStake\MediaWiki\Component\FormEngine\StandaloneFormSpecification` object to `$formSpecification`param to use a custom form.

```
$formSpec = new StandaloneFormSpecification();
		$formSpec->setItems( [
			[
				'type' => 'text',
				'name' => 'field',
				'label' => 'My field',
			],
			[
				'type' => 'checkbox',
				'name' => 'framed',
				'label' => 'Is framed'
			],
		] );

```

### With client-side defined form

[](#with-client-side-defined-form)

You can implement an instance of `mw.ext.forms.standalone.Form` client-side and use it in the `ClientTagSpecification`

For that you would pass a `MWStake\MediaWiki\Component\FormEngine\FormLoaderSpecification` as `$formSpecification` param.

```
$formSpec = new FormLoaderSpecification( 'my.form.class', [ 'modules.loading.the.form.class' ] );
```

### Register custom VisualEditor definition classes

[](#register-custom-visualeditor-definition-classes)

In very specific cases you may want to override the default VisualEditor tag definition class

Load a JS file using `getResourceLoaderModules` method, that will override the tag class

```
mw.hook( 'ext.visualEditorPlus.tags.getTagDefinition' ).add( ( definitionData, tagDefinition ) =>  {
	if ( definitionData.tagname !== 'myfancytag' ) {
		return;
    }

	// definition data contains the info from `ClientTagSpecification`

	tagDefinition = new my.class.inheriting.from.ext.visualEditorPlus.ui.tags.Definition( {
        ... data
    } );
};
```

In this case, you would likely pass `null` to `$formSpecification` param in the PHP class.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance85

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~61 days

Total

5

Last Release

119d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e39dfe9d3120de240053c4283e905254e8774d3278da25ad79974a8742c55192?d=identicon)[osnard](/maintainers/osnard)

![](https://www.gravatar.com/avatar/161c38b5448b71865cf0652b6974ed489dd3683b5d6e1814973cea6cb66c8f1d?d=identicon)[dsavuljesku](/maintainers/dsavuljesku)

---

Top Contributors

[![it-spiderman](https://avatars.githubusercontent.com/u/13665198?v=4)](https://github.com/it-spiderman "it-spiderman (15 commits)")[![HamishSlater](https://avatars.githubusercontent.com/u/26261210?v=4)](https://github.com/HamishSlater "HamishSlater (8 commits)")[![osnard](https://avatars.githubusercontent.com/u/1201528?v=4)](https://github.com/osnard "osnard (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![miriamschlindwein](https://avatars.githubusercontent.com/u/13835398?v=4)](https://github.com/miriamschlindwein "miriamschlindwein (2 commits)")

### Embed Badge

![Health badge](/badges/mwstake-mediawiki-component-generictaghandler/health.svg)

```
[![Health](https://phpackages.com/badges/mwstake-mediawiki-component-generictaghandler/health.svg)](https://phpackages.com/packages/mwstake-mediawiki-component-generictaghandler)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
