PHPackages                             esign/craft3-fields - 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. esign/craft3-fields

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

esign/craft3-fields
===================

Address, telephone and email fields for CraftCMS

1.0.1(2y ago)023MITPHP

Since May 8Pushed 2y agoCompare

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

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

A collection of custom Fields CraftCMS
======================================

[](#a-collection-of-custom-fields-craftcms)

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

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:

```
$ composer require newism/craft-fields && ./craft plugin/install nsm-fields
```

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

[](#configuration)

- If you're using Address Autocomplete you'll need an [api key](https://developers.google.com/places/web-service/get-api-key).
- If you're embedding Instagram you'll need an [api key](https://developers.facebook.com/docs/instagram/oembed).
- If you're embedding Facebook you'll need an [api key](https://developers.facebook.com/docs/plugins/oembed).

Add the api keys to your environment and set in the plugin settings. See:

Alternatively…

Copy `src/config.php` to `CRAFT_CONFIG_PATH` and rename the file to `nsm-fields.php`.

---

Fields
======

[](#fields)

Address
-------

[](#address)

Address field powered by Google's dataset ([commerceguys/addressing](https://github.com/commerceguys/addressing)).

Features:

- Auto-complete powered by Google Place API
- Map powered by Google Maps Javascript API and Google Maps Geocoding API
- Address form formatting based on country powered by [commerceguys/addressing](https://github.com/commerceguys/addressing)
- Validation / Geo-coding on submission (TODO)

Template Tags:

The [`normalizeValue`](./src/fields/Address.php#L504) method always returns an [`AddressModel`](./src/models/AddressModel.php). All public properties are available:

Given `entry.address` is your field…

```
See: https://github.com/commerceguys/addressing/blob/master/src/AddressInterface.php
{{ entry.address.countryCode }}
{{ entry.address.administrativeArea }}
{{ entry.address.locality }}
{{ entry.address.dependentLocality }}
{{ entry.address.postalCode }}
{{ entry.address.sortingCode }}
{{ entry.address.addressLine1 }}
{{ entry.address.addressLine2 }}
{{ entry.address.organization }}
{{ entry.address.recipient }}
{{ entry.address.locale }}

See: https://github.com/commerceguys/addressing/blob/master/src/Country/Country.php
{{ entry.address.country.countryCode }}
{{ entry.address.country.name }}
{{ entry.address.country.threeLetterCode }}
{{ entry.address.country.numericCode }}
{{ entry.address.country.currencyCode }}
{{ entry.address.country.locale }}

{{ entry.address.placeData }}
{{ entry.address.latitude }}
{{ entry.address.longitude }}
{{ entry.address.mapUrl }}

```

[![Address Demo](resources/img/address-demo.gif)](resources/img/address-demo.gif)

Telephone
---------

[](#telephone)

Telephone field powered by [Googles phone number library](https://github.com/googlei18n/libphonenumber) implemented via [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php)

Features:

- Validate phone number based on country code
- Format phone number as E164, international, national or RFC3966
- Stores Telephone model and raw user input

Template Tags:

Given `entry.telephone` is your field…

`{{ entry.telephone }}` outputs the phone number in international format.

You can also choose a specific format:

```
{{ entry.telephone.format('E164') }}
{{ entry.telephone.format('international') }}
{{ entry.telephone.format('national') }}
{{ entry.telephone.format('RFC3966') }}

```

The raw input from the user is also available:

`{{ entry.telephone.rawInput }}`

[![Telephone Demo](resources/img/telephone-demo.gif)](resources/img/telephone-demo.gif)

Email
-----

[](#email)

Features:

- Email validation using Yii validation

[![Email Demo](resources/img/email-demo.gif)](resources/img/email-demo.gif)

Embed
-----

[](#embed)

Features:

- Embed social media posts / media directly from a URL
- Live preview

Template Tags:

Given `entry.embedField` is your field…

- `{{ entry.embedField.embedData }}` outputs the returned embed object.
- `{{ entry.embedField.embedData.code | raw }}` outputs the returned embed javascript code.

Additional data:

```
{{ entry.embedField.embedData.authorName }} // The resource author
{{ entry.embedField.embedData.authorUrl }} // The author url
{{ entry.embedField.embedData.cms }} // The cms used
{{ entry.embedField.embedData.code.html }} // The code to embed the image, video, etc
{{ entry.embedField.embedData.code.width }} // The exact width of the embed code (if exists)
{{ entry.embedField.embedData.code.height }} // The exact height of the embed code (if exists)
{{ entry.embedField.embedData.code.aspectRatio }} // The aspect ratio (width/height)
{{ entry.embedField.embedData.description }} //The page description
{{ entry.embedField.embedData.favicon }} // The favicon of the site (an .ico file or a png with up to 32x32px)
{{ entry.embedField.embedData.feeds }} // The RSS/Atom feeds
{{ entry.embedField.embedData.icon }} // The big icon of the site
{{ entry.embedField.embedData.image }} // The thumbnail or main image
{{ entry.embedField.embedData.keywords }} // The page keywords
{{ entry.embedField.embedData.language }} // The language of the page
{{ entry.embedField.embedData.languages }} // The alternative languages
{{ entry.embedField.embedData.license }} // The license url of the resource
{{ entry.embedField.embedData.providerName }} // The provider name of the page (Youtube, Twitter, Instagram, etc)
{{ entry.embedField.embedData.providerUrl }} // The provider url
{{ entry.embedField.embedData.publishedTime }} // The published time of the resource
{{ entry.embedField.embedData.redirect }}
{{ entry.embedField.embedData.title }} //The page title
{{ entry.embedField.embedData.url }} //The canonical url
{{ entry.embedField.embedData.ombed }} // oembed data
{{ entry.embedField.embedData.linkedData }} // json-LD data

```

Note: embed data saved with v1 saved the html to `{{entry.embedField.embedData.code}}`. In v2 `{{ entry.embedField.embedData.code }}` changed to an array. Your templates will need to account for both versions… something like:

```
{{ (entry.embedField.embedData.code.html|default ?: entry.embedField.embedData.code|default) | raw }}

```

[![Embed Demo](resources/img/embed-demo.gif)](resources/img/embed-demo.gif)

Person Name
-----------

[](#person-name)

Person name field with:

- Honorific Prefix
- Given Names
- Additional Names
- Family Names
- Honorific Suffix

[![Person Name Demo](resources/img/person-name-field.png)](resources/img/person-name-field.png)

Gender
------

[](#gender)

Non-binary gender field with:

- Sex
- Identity

[![Gender](resources/img/gender-field.png)](resources/img/gender-field.png)

Road Map
--------

[](#road-map)

Some things to do, and ideas for potential features:

- Split out each field into it's own plugin. Keep this plugin as a single composer file which pulls all fields in
- Address validation / Geo-coding on submission
- Display address as text in field with option to "Edit" to reduce size of field in UI
- Update commerceguys/addressing when next stable version is released

Credits
-------

[](#credits)

Brought to you by [Newism](http://newism.com.au)

[![](https://camo.githubusercontent.com/c03fd457cd8200454086f64bc5b6efa93d53368f9a8af669fc6d418f917bab9f/687474703a2f2f6e657769736d2e636f6d2e61752f75706c6f6164732f636f6e74656e742f6e657769736d2d6c6f676f2e706e67)](http://newism.com.au/)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.7% 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 ~0 days

Total

2

Last Release

740d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4599d7a8f6fdb63dd04305a49ae5ec9700b7a6eacdbe3a54f89584d75e34503f?d=identicon)[esign](/maintainers/esign)

---

Top Contributors

[![leevigraham](https://avatars.githubusercontent.com/u/25124?v=4)](https://github.com/leevigraham "leevigraham (122 commits)")[![SamNewism](https://avatars.githubusercontent.com/u/48192794?v=4)](https://github.com/SamNewism "SamNewism (12 commits)")[![iainsaxon](https://avatars.githubusercontent.com/u/546517?v=4)](https://github.com/iainsaxon "iainsaxon (5 commits)")[![swey](https://avatars.githubusercontent.com/u/568574?v=4)](https://github.com/swey "swey (2 commits)")[![thomascoppein](https://avatars.githubusercontent.com/u/58168425?v=4)](https://github.com/thomascoppein "thomascoppein (2 commits)")[![MakeilaLundy](https://avatars.githubusercontent.com/u/19892516?v=4)](https://github.com/MakeilaLundy "MakeilaLundy (2 commits)")[![thomasgoemaere](https://avatars.githubusercontent.com/u/1284055?v=4)](https://github.com/thomasgoemaere "thomasgoemaere (1 commits)")[![timkelty](https://avatars.githubusercontent.com/u/18329?v=4)](https://github.com/timkelty "timkelty (1 commits)")[![urbantrout](https://avatars.githubusercontent.com/u/10465787?v=4)](https://github.com/urbantrout "urbantrout (1 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (1 commits)")[![webrgp](https://avatars.githubusercontent.com/u/994788?v=4)](https://github.com/webrgp "webrgp (1 commits)")[![domstubbs](https://avatars.githubusercontent.com/u/717265?v=4)](https://github.com/domstubbs "domstubbs (1 commits)")[![jamiewade](https://avatars.githubusercontent.com/u/6672331?v=4)](https://github.com/jamiewade "jamiewade (1 commits)")[![joshuabaker](https://avatars.githubusercontent.com/u/160484?v=4)](https://github.com/joshuabaker "joshuabaker (1 commits)")[![markhuot](https://avatars.githubusercontent.com/u/48975?v=4)](https://github.com/markhuot "markhuot (1 commits)")[![RosanaRufer](https://avatars.githubusercontent.com/u/4906291?v=4)](https://github.com/RosanaRufer "RosanaRufer (1 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginnsm-fields

### Embed Badge

![Health badge](/badges/esign-craft3-fields/health.svg)

```
[![Health](https://phpackages.com/badges/esign-craft3-fields/health.svg)](https://phpackages.com/packages/esign-craft3-fields)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

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

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)

PHPackages © 2026

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