PHPackages                             bencarr/statamic-hyperlink - 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. bencarr/statamic-hyperlink

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

bencarr/statamic-hyperlink
==========================

Hyperlink is a Statamic addon for a turbo-charged link field that stores link text and target options alongside the destination, supports multiple links in a single field, and lets you set up reusable config-driven field settings.

v3.0.4(1y ago)36181PHPPHP ^8.1CI passing

Since Jun 2Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/bencarr/statamic-hyperlink)[ Packagist](https://packagist.org/packages/bencarr/statamic-hyperlink)[ RSS](/packages/bencarr-statamic-hyperlink/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (18)Used By (0)

Hyperlink
=========

[](#hyperlink)

> Hyperlink is a Statamic addon for a turbo-charged link field that stores link text and target options alongside the destination, supports multiple links in a single field, and lets you set up reusable config-driven field settings.

Hyperlink is great for CTAs, callouts, and hero buttons, and has everything you need for a smooth author and developer experience:

- **Multiple links in a single field** to you simplify your blueprints and avoid needing a replicator or separate field to store more than one link
- **Link to everything** including entries, URLs, email addresses, assets, taxonomy terms, and phone numbers
- **Multi-site support** for localizing links
- **Flexible templating options** for both [Antlers](#antlers) and [Blade](#blade)
- **Reusable field configurations** across blueprints using config-driven [Profiles](#profiles)

Get Started
-----------

[](#get-started)

- [Installation](#installation)
- [Upgrade Guide](#upgrade-guide)
- [Configuration](#configuration)
    - [Profiles](#profiles)
    - [Profile options](#profile-options)
    - [Field-specific settings](#field-specific-settings)
- [Templating](#templating)
    - [Antlers](#antlers)
    - [Blade](#blade)
    - [Available data](#available-data)
- [Validation](#validation)
- [Schema](#schema)
- [Licensing](#licensing)

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

[](#installation)

You can find and install Hyperlink from the Statamic control panel under *Tools → Addons*, or install from your project root using [Composer](https://getcomposer.org).

```
composer require bencarr/statamic-hyperlink
```

Upgrade Guide
-------------

[](#upgrade-guide)

You can upgrade from version 1.x or 2.x to 3.x by re-requiring the package with a new version string:

```
composer require bencarr/statamic-hyperlink:^3.0
```

That’s it! There’s no immediate changes needed to your content or templates after simply installing v3.

### Updating a Field to Support Multiple Links

[](#updating-a-field-to-support-multiple-links)

If you'd like to take advantage of multiple links on an existing Hyperlink field, you can update your field configuration to set the "Minimum Number of Links" and "Max Number of Links" options accordingly.

If you're using a [Profile](#profiles) for your field configuration, you can adjust the `min_items` and `max_items` keys in your profile’s configuration array.

Once you've updated a field to support multiple links, your templates will need to be updated to account for receiving an *array* of hyperlinks instead of a single hyperlink. Check out the [Templating](#templating) section for examples.

Configuration
-------------

[](#configuration)

Add a Hyperlink field to your blueprint by selecting it from the “Relationship” or “Special” groups.

### Profiles

[](#profiles)

Profiles let you re-use Hyperlink configurations across multiple blueprints. You can set up profiles in a config file, then select which profile each field should use. Future changes can be made in the profile configuration without needing to update each field’s settings.

#### Customizing the default profile

[](#customizing-the-default-profile)

Start customizing profiles by publishing the `hyperlink-config` tag.

```
php artisan vendor:publish --tag=hyperlink-config
```

You can find the published configuration in `config/statamic/hyperlink.php`.

#### Adding additional profiles

[](#adding-additional-profiles)

Make additional profiles available by adding new keys to the `profiles` array.

```
