Download the PHP package jacksleight/statamic-focal-link without Composer

On this page you can find all versions of the php package jacksleight/statamic-focal-link. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-focal-link

Focal Link Fieldtype

This Statamic addon simplifies linking to URL hashes (fragment identifiers) by automatically discovering IDs in the destination page and providing templates for common formats. Also supports fixed options, manual input and query strings.

Automatic discovery works by scanning the destination page for IDs and allowing you to select one from a list. You can control exactly which IDs are discovered using XPath expressions. Templates work by prompting the user for a value and then automatically URL encoding it.

Installation

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

Configuration

The default configuration comes with a couple of examples to get you started, but as every site is different you'll need to tell it what to enable and how for best results. To do this publish the config:

And then open config/statamic/focal_link.php.

Getting Started

Each key in the types list should be a pattern that matches a type of link. These can contain asterisks to perform wildcard matches. They should be in order of specificity (lowest to highest), the most specific match wins.

Each type can contain the following settings:

If fragments or queries are excluded those fields will not appear at all.

Fragment & Query Options

Options can either be a fixed value or a template value. Templates must contain the string {{ [placeholder] }}, this where the cursor will be placed when the template is selected.

ID Discovery

You can enable automatic ID discovery by setting the discovery option to an array of XPath expressions, these will be used to find matching elements in the destination page.

The key should be the path to the elements containing the ID attribute, the value should be the path to the node that contains the label, relative to the element. If the label expression is not set or the node cannot be found a label will be generated from the ID using Str::headline().

Example Link Type Settings

Check out the examples and included template presets for more examples.

Warning: If you enable discovery on external sites bear in mind that site design changes may invalidate the XPath expressions you write.

Fieldtype Options

Automatic Heading IDs

Shameless Plug: You can use my Bard Mutator addon to automatically apply IDs to heading elements rendered by the Bard fieldtype, and then use this addon to link directly to them. Here's the mutator function you'll need:

Popular Site Template Presets

The addon comes with a couple of template presets for popular sites. If you know of others and would like them added feel free to submit an issue or PR.

Link Fieldtype Compatibility

This fieldtype tries to work as seamlessly as possible with the built-in Link fieldtype, by wrapping a Link field and then bolting on the additional features. Depending on the link this either stores values in an identical format or a suffixed format.

Any Link field can be changed to a Focal Link field and the values will be compatible. However if you change a Focal Link field back to a Link field Entry values with a query or fragment set will not be compatible, the suffixes will need to be removed.

Licencing

Statamic Focal Link is not free software. You will need to purchase a license via the Statamic Marketplace to use it in production.

Contributing

Contributions are very welcome, however please bear in mind that while Focal Link's source code is open source and publicly available, it is proprietary. Everything in this repo, including any community-contributed code, is the property of Jack Sleight.


All versions of statamic-focal-link with dependencies

PHP Build Version
Package Version
Requires statamic/cms Version ^4.0|^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jacksleight/statamic-focal-link contains the following files

Loading the files please wait ....