PHPackages                             mediawiki/alink - 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. mediawiki/alink

ActiveMediawiki-extension[Utility &amp; Helpers](/categories/utility)

mediawiki/alink
===============

Creates custom anchor links

0.4.0(2w ago)1306GPL-3.0-or-laterPHPPHP &gt;=7.4.3

Since Nov 27Pushed 1w ago2 watchersCompare

[ Source](https://github.com/SimilisTools/mediawiki-alink)[ Packagist](https://packagist.org/packages/mediawiki/alink)[ Docs](https://github.com/SimilisTools/mediawiki-alink)[ RSS](/packages/mediawiki-alink/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (6)Used By (0)

Alink
=====

[](#alink)

MediaWiki extension (type: `parserhook`) that provides two parser functions for rendering raw HTML `` and `` tags with full attribute control.

- **Version:** 0.3.0
- **License:** GPL-3.0-or-later
- **Requires:** MediaWiki &gt;= 1.35.0, PHP &gt;= 7.2
- **Repository:**

Installation
------------

[](#installation)

1. Clone or extract into `extensions/Alink/`.
2. Add to `LocalSettings.php`: ```
    wfLoadExtension( 'Alink' );
    ```

Parser functions
----------------

[](#parser-functions)

### `#alink` — anchor tag

[](#alink--anchor-tag)

```
{{#alink: href= |  |  | link text }}

```

**Allowed attributes:** `href`, `rel`, `target`, `class`, `id`, `content`, `name`, `itemprop`, and any `data-*` attribute.

**Flags (no `=` sign):**

FlagEffect`nourlencode`Skip `urlencode()` on the page name (useful for query strings with special characters)`noprefix`Strip namespace prefix from auto-generated link text**Link text** is the bare argument (no `=`). If omitted, falls back to the `href` value; with `noprefix`, falls back to the page title without namespace.

**Internal vs external links:** if `href` starts with `http://`, `https://`, or `ftp://`, the value is used as-is. Otherwise it is treated as a wiki page name and resolved through `$wgArticlePath`.

#### Examples

[](#examples)

External link:

```
{{#alink: href=https://www.mediawiki.org | target=_blank | rel=nofollow | MediaWiki }}

```

Internal wiki page:

```
{{#alink: href=Example_page | target=_blank | Example page }}

```

Internal link with special characters in query string (skip URL encoding):

```
{{#alink: href=Special:FormEdit/Myform/Mypage?MyTemplate[Myparam]=Acción | nourlencode | Trigger action }}

```

Internal link, display title without namespace:

```
{{#alink: href=User:John_Smith | noprefix }}

```

With `data-*` attribute:

```
{{#alink: href=Main_Page | data-tracking=nav | Home }}

```

---

### `#aimg` — image tag

[](#aimg--image-tag)

```
{{#aimg: src= |  }}

```

**Allowed attributes:** `src`, `rel`, `title`, `alt`, `class`, `id`, `content`, `itemprop`, and any `data-*` attribute.

If `src` does not start with a recognized protocol, it is treated as a MediaWiki file name and resolved to its full URL via `wfFindFile()`. If the file does not exist in the wiki, `src` is left unchanged.

#### Examples

[](#examples-1)

External image:

```
{{#aimg: src=https://example.com/logo.png | alt=Logo | class=site-logo }}

```

Wiki-hosted file:

```
{{#aimg: src=Example.png | alt=Example image | title=An example }}

```

---

Development
-----------

[](#development)

Install dependencies:

```
composer install
```

Lint (syntax check + executable-bit check):

```
composer test
```

Fix executable bits:

```
composer fix
```

PHP CodeSniffer (requires `mediawiki/mediawiki-codesniffer` installed separately):

```
vendor/bin/phpcs
```

There are no automated unit tests. Manual testing requires a running MediaWiki instance with the extension loaded.

Notes
-----

[](#notes)

- Output is passed through `$parser->insertStripItem()` to prevent further wiki parsing of the raw HTML.
- Using raw `` tags bypasses MediaWiki's link tracking (incoming/outgoing links are not recorded in the database). Use standard wikitext links when link tracking matters.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~963 days

Total

5

Last Release

16d ago

PHP version history (3 changes)0.1.1PHP &gt;=5.3.0

v0.3.0PHP &gt;=7.2

0.4.0PHP &gt;=7.4.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/5218ca0754245ef120fb4ebc1c520616cb8339e5e4f81301e4906893859d5404?d=identicon)[toniher](/maintainers/toniher)

---

Top Contributors

[![toniher](https://avatars.githubusercontent.com/u/535539?v=4)](https://github.com/toniher "toniher (47 commits)")

---

Tags

linkmediawiki

### Embed Badge

![Health badge](/badges/mediawiki-alink/health.svg)

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

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[mediawiki/chameleon-skin

A highly flexible MediaWiki skin using Bootstrap 5

12585.7k2](/packages/mediawiki-chameleon-skin)[civicrm/civicrm-drupal-8

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

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)

PHPackages © 2026

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