micschk / silverstripe-namedlinkfield
A SilverStripe composite field for having various link types *with title*, in a single field with a nicely styled form.
Package info
github.com/restruct/silverstripe-namedlinkfield
Type:silverstripe-vendormodule
pkg:composer/micschk/silverstripe-namedlinkfield
Requires
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- dev-main
- 3.0.2
- 3.0.1
- 3.0.0
- v2.x-dev
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3
- 1.2
- 1.1
- 1.0
- dev-dependabot/npm_and_yarn/follow-redirects-1.16.0
- dev-dependabot/npm_and_yarn/picomatch-2.3.2
- dev-dependabot/npm_and_yarn/lodash-4.18.1
- dev-dependabot/npm_and_yarn/svgo-2.8.2
- dev-dependabot/npm_and_yarn/minimatch-3.1.5
- dev-dependabot/npm_and_yarn/webpack-5.104.1
- dev-release-2.1.4
This package is auto-updated.
Last update: 2026-09-22 11:10:05 UTC
README
A single inline link field which allows users to set a title/name for the link, and select
- a page + optional text-anchor from the site tree
- a file from the assets dir
- an e-mail address (mailto link)
- define a custom URL to link to
- or enter a shortcode
Usage
use Restruct\SilverStripe\ORM\FieldType\NamedLinkField; use Restruct\SilverStripe\Forms\NamedLinkFormField; ... private static $db = array( 'NextAction' => NamedLinkField::class, ); ... public function getCMSFields() { $fields = parent::getCMSFields(); $fields->insertBefore( "Content", NamedLinkFormField::create('ActionButton') ); return $fields; }
TODO
- Check source-class-HtmlEditorField_Toolbar.html#_LinkForm for inline uploading of files etc
- Make translatable/i18n
Version compatibility
| Branch | Module version | Silverstripe | PHP |
|---|---|---|---|
main |
3.x |
^6 |
^8.3 |
v2 |
2.1.x |
^4 || ^5 |
>=7.4 |
Silverstripe 6 required breaking changes here (typed method signatures and ModelData), so the
lines are split rather than shared. v2 receives security and bug fixes until Silverstripe 5
reaches end of life in April 2027; new work goes on main.
composer.json is the source of truth for exact constraints; this table is a quick reference.
Running the tests
The module needs a host Silverstripe project. Require it there through a Composer path repository
with symlink: true - /tests is export-ignore, so a dist or mirrored install has no tests -
add its test namespace to the host's autoload-dev, then:
SS_PHPUNIT_FLUSH=1 vendor/bin/phpunit --testsuite namedlinkfield
CI runs the same suite on every push; see .github/workflows/ci.yml.