PHPackages                             vaersaagod/linkmate - 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. vaersaagod/linkmate

ActiveCraft-plugin

vaersaagod/linkmate
===================

Let's hook you up, mate!

2.5.1(2y ago)11.9k1[1 issues](https://github.com/vaersaagod/linkmate/issues)MITPHPPHP ^8.0.2

Since Apr 28Pushed 1y ago3 watchersCompare

[ Source](https://github.com/vaersaagod/linkmate)[ Packagist](https://packagist.org/packages/vaersaagod/linkmate)[ RSS](/packages/vaersaagod-linkmate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (22)Used By (0)

LinkMate plugin for Craft CMS
=============================

[](#linkmate-plugin-for-craft-cms)

*Let's hook you up, mate!*

[![Screenshot](resources/img/plugin-icon.png)](resources/img/plugin-icon.png)

This is a link field for Craft CMS, forked from Sebastian Lenz' fabolous [Typed Link Field](https://github.com/sebastian-lenz/craft-linkfield) (v1). It's made for Værsågod &amp; friends - no support is given whatsoever. You should probably use the original instead.

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4.0.0 or later.

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

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require vaersaagod/linkmate

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for LinkMate.

Templating
----------

[](#templating)

Link fields on your models will return an instance of `vaersaagod\linkmate\models\Link`. Rendering a link field directly within a template will return the url the field is pointing to.

```
Link

```

You can use the following accessors to get the different properties of the link:

```
{{ item.myLinkField.getElement() }}
{{ item.myLinkField.getLinkAttributes() }}
{{ item.myLinkField.getTarget() }}
{{ item.myLinkField.getText() }}
{{ item.myLinkField.getUrl() }}
{{ item.myLinkField.hasElement() }}
{{ item.myLinkField.isEmpty() }}
{{ item.myLinkField.getCustomText() }}

```

Use the `getLink` utility function to render a full html link:

```
{{ item.myLinkField.getLink() }}

```

You can pass the desired content of the link as a string, e.g.

```
{{ entry.linkField.getLink('Imprint') }}

```

You may also pass an array of attributes. When doing this you can override the default attributes `href` and `target`. The special attribute `text`will be used as the link content.

```
{{ entry.linkField.getLink({
  class: 'my-link-class',
  target: '_blank',
  text: 'Imprint',
}) }}

```

You can also compose your own markup quickly by simply consuming the link attributes exposed by `getLinkAttributes` on the link model. This method accepts an additional parameter allowing you to inject additional attributes as an associative array.

```

  Custom markup

```

API
---

[](#api)

You can register additional link types by listening to the `EVENT_REGISTER_LINK_TYPES`event of the plugin. If you just want to add another element type, you can do it like this in your module:

```
use craft\commerce\elements\Product;
use vaersaagod\linkmate\LinkMate as LinkPlugin;
use vaersaagod\linkmate\events\LinkTypeEvent;
use vaersaagod\linkmate\models\ElementLinkType;
use yii\base\Event;

/**
 * Custom module class.
 */
class Module extends \yii\base\Module
{
  public function init() {
    parent::init();
    Event::on(
      LinkPlugin::class,
      LinkPlugin::EVENT_REGISTER_LINK_TYPES,
      function(LinkTypeEvent $event) {
        $event->linkTypes['product'] = new ElementLinkType(Product::class);
      }
    );
  }
}
```

Each link type must have an unique name and a definition object implementing `vaersaagod\linkmate\modles\LinkTypeInterface`. Take a look at the bundled link types `ElementLinkType` and `InputLinkType` to get an idea of how to write your own link type definitions.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 82.9% 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 ~83 days

Total

20

Last Release

628d ago

Major Versions

1.1.0 → 2.0.02022-05-06

2.5.1 → 3.0.0-beta.12024-02-20

PHP version history (3 changes)2.0.0PHP ^8.0

2.0.2PHP ^8.0.2

3.0.0-beta.1PHP ^8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2580dc72f65006fb038f68d3299615d97cdda269d0d487639a89cf2628b1176f?d=identicon)[vaersaagod](/maintainers/vaersaagod)

---

Top Contributors

[![mmikkel](https://avatars.githubusercontent.com/u/298510?v=4)](https://github.com/mmikkel "mmikkel (29 commits)")[![aelvan](https://avatars.githubusercontent.com/u/2675644?v=4)](https://github.com/aelvan "aelvan (6 commits)")

---

Tags

craft-plugincraft3craftcmslinkcmsCraftcraftcmscraft-pluginlinkmate

### Embed Badge

![Health badge](/badges/vaersaagod-linkmate/health.svg)

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

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[acclaro/translations

Easily launch and manage multilingual Craft websites without having to copy/paste content or manually track updates.

1229.5k](/packages/acclaro-translations)

PHPackages © 2026

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