Download the PHP package pauloamgomes/cockpitcms-betterslugs without Composer

On this page you can find all versions of the php package pauloamgomes/cockpitcms-betterslugs. 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 cockpitcms-betterslugs

Better Slugs Addon for Cockpit CMS

This addon enhances Cockpit CMS by providing a slug field type that can be used to generate automatically slugs for your collections. Tokens are supported in order to dynamically set values (e.g. dates, fields, etc..).

Idea was partially taken by the Unique Slugs addon https://github.com/raffaelj/cockpit_UniqueSlugs

Installation

Manual

Download latest release and extract to COCKPIT_PATH/addons/BetterSlugs directory

Git

Cockpit CLI

Composer

  1. Make sure path to cockpit addons is defined in your projects' composer.json file:

  2. In your project root run:

Usage

Add a new field of type slug to your collection and configure a format, e.g:

For a collection named post it will result in something like post/2019/your-post-title, if you want to start with / like /post/2019/your-post-title use:

You can also use static values in the slug e.g. starting with blogs like blogs/2019/01/your-post-title:

If you are using localization and want to have your slug prefixed with the corresponding language id like en/post/2019/your-post-title

And using a custom callback function:

Assuming you have the slugUniqId function (e.g. in a boostrap.php addon file):

it will return in something like blogs/5c2ccc816619b/your-post-title

The callback function receives the $entry array as argument.

Currently the following tokens are supported:

If we have a field named country that is a collection link, it will retrieve the collection link entry values and extract the name field, so it would result in something like: countries/netherlands/my-title

By default the generated slugs are unique, so if you have a slug field configured with format:

and your field title is "Blog Test" blogs/2019/01/blog-test, if you insert another entry with same title it will result on blogs/2019/01/blog-test-1, and next one on blogs/2019/01/blog-test-2.

The slug is only autogenerated when the field value is empty, so it can be overriden by the user with a non generated value.

Localization is supported, just enable in the field definition and the corresponding field language names (e.g. slug, slug_en, slug_pt) will be automatically populated.

A CLI command can be used to update all slugs in a collection:

Copyright and license

Copyright 2019 pauloamgomes under the MIT license.


All versions of cockpitcms-betterslugs with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.3
composer/installers Version ^1.10
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 pauloamgomes/cockpitcms-betterslugs contains the following files

Loading the files please wait ....