Download the PHP package ncla/statamic-focal-point-fieldtype without Composer
On this page you can find all versions of the php package ncla/statamic-focal-point-fieldtype. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ncla/statamic-focal-point-fieldtype
More information about ncla/statamic-focal-point-fieldtype
Files in ncla/statamic-focal-point-fieldtype
Package statamic-focal-point-fieldtype
Short Description Standalone asset focal point fieldtype for Statamic
License MIT
Informations about the package statamic-focal-point-fieldtype
Focal Point Fieldtype
The Statamic control panel has very useful focal point selection tool, unfortunately you can only set one focal point only for one asset. Fortunately this addon provides a fieldtype that allows you to set focal point in a separate field for an asset that has been linked in an assets field.
This addon can be useful in situations such as:
- You want to change focal point between responsive breakpoints
- Your site has the same asset appearing in multiple places and you do not want them all to share the same focal point
- You want to add "pins" to an image e.g. a map with interest points
Installation
Require it using Composer.
Fieldtype
As any fieldtype, you can add it through control panel interface. You will find the fieldtype in the "Media" category. In field options, you will just have to define "Assets Field Handle" and that is it.
Alternatively if you are feeling hacker vibes, you can of course add this fieldtype to your fields by editing blueprint file directly:
Templating
Once focal point is set, you can pass it in your templates to Glide tag like this:
If you are using Responsive Images addon then here is an example of having two different focal points for two breakpoints:
Show support
If you find my work helpful and of value, consider showing appreciation.