PHPackages                             iqnection-modules/linkfield - 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. iqnection-modules/linkfield

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

iqnection-modules/linkfield
===========================

SilverStripe Link Field

2.1.0.2(7y ago)035214BSD-3-ClausePHP

Since Aug 26Pushed 2y ago3 watchersCompare

[ Source](https://github.com/iqnection-programming/iqnection-silverstripe-modules-linkfield)[ Packagist](https://packagist.org/packages/iqnection-modules/linkfield)[ RSS](/packages/iqnection-modules-linkfield/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (9)Used By (4)

Link Field
==========

[](#link-field)

Works just like the RedirectorPage URL/Page field Provides and interface for creating an internal or external link. Internal link provides a TreeDropdownField for selecting a page within the site tree External provides a text field for entering the full URL Also provides availability to store opening in a new tab

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

[](#requirements)

Silverstripe 4+

Install
-------

[](#install)

composer require iqnection-modules/linkfield

Usage
-----

[](#usage)

### In your DataObject class, use the DB field "Link"

[](#in-your-dataobject-class-use-the-db-field-link)

```
private static $db = array(
	'LinkedPage' => 'Link'
);

```

### In your forms (CMS only)

[](#in-your-forms-cms-only)

```
$fields->push( IQnection\LinkField\LinkField::create($name,$title) );

```

setValue() expects either an array or serialized array of the following:

```
array(
	'Location' => string ['Internal' | 'External'] (required)
	'Internal' => int [SiteTree Page ID]
	'External' => string [external URL | null],
	'NewTab' => [bool]
);

```

### In your templates

[](#in-your-templates)

```
Link Text

```

DB class methods
----------------

[](#db-class-methods)

### URL

[](#url)

the raw entered URL for External, or $Page-&gt;Link() for internal

### AbsoluteURL

[](#absoluteurl)

an absolute URL for external (adds http://), or $Page-&gt;AbsoluteLink() for internal

### LinkedPage

[](#linkedpage)

for internal only, returns the linked page SiteTree object

### forTemplate

[](#fortemplate)

returns URL()

### IsExternal

[](#isexternal)

returns bool, if the link is external

### Location

[](#location)

returns string, the location set as either Internal or External

### Target

[](#target)

returns \_blank or self for use in a target HTML attribute

### TargetATT(force=false)

[](#targetattforcefalse)

returns a full target attribute, for new tab only \[target="\_blank"\] pass $force=true to return attribute for both new tab and same tab

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~72 days

Total

8

Last Release

2835d ago

Major Versions

0.0.1.1 → 1.0.x-dev2017-09-21

1.0.x-dev → 2.0.02017-12-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8713560?v=4)[Mike Eckert](/maintainers/iqmeckert)[@iqmeckert](https://github.com/iqmeckert)

---

Top Contributors

[![iqmeckert](https://avatars.githubusercontent.com/u/8713560?v=4)](https://github.com/iqmeckert "iqmeckert (12 commits)")

---

Tags

moduleiqnection

### Embed Badge

![Health badge](/badges/iqnection-modules-linkfield/health.svg)

```
[![Health](https://phpackages.com/badges/iqnection-modules-linkfield/health.svg)](https://phpackages.com/packages/iqnection-modules-linkfield)
```

###  Alternatives

[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39344.8k30](/packages/lekoala-silverstripe-cms-actions)[lekoala/silverstripe-softdelete

Soft delete extension for SilverStripe

11236.3k](/packages/lekoala-silverstripe-softdelete)[silverstripers/seo

SEO for SilverStripe websites

1145.4k](/packages/silverstripers-seo)

PHPackages © 2026

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