Download the PHP package ttempleton/craft-category-groups-field without Composer

On this page you can find all versions of the php package ttempleton/craft-category-groups-field. 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 craft-category-groups-field

Category Groups Field

A category groups field type for Craft CMS.

Usage

Single Selection setting

The Single Selection field setting controls the behaviour of a category groups field. When this setting is disabled, the field will resemble a typical multi-select field on an element edit page, and accessing the field in your templates will give you the category group collection. When Single Selection is enabled, the field will resemble a dropdown field on an element edit page, and accessing the field in your templates will give you the category group model.

Field data is not altered immediately on changing this setting, in case the setting was changed by accident; the data will only be overwritten when actually resaving its element. However, when Single Selection is enabled, the element edit page and templates will treat the first (in alphabetical order) selected category group as the field's only category group.

New category groups fields will default to multiple group selection. If you'd prefer to use Single Selection as default, copy the following into config/category-groups-field.php:

Template example: Single Selection disabled

This example uses a category group collection's all() method to loop through the collection's groups.

A multi-select category groups field's data can be accessed in templates in a way that mimics the execution methods of a typical Craft element query, including the methods all(), one(), nth(), count() and ids().

It can also be used to get the categories belonging to the selected category groups, using the categories() method to return a Craft category query:

After using categories(), if you want to set any other category query parameters, be careful not to set the groupId, since it will override the IDs of the groups selected in the field. If you need to set additional category group IDs, you can pass a hash to categories() containing category query parameters, and any group IDs included will be merged with those selected in the field:

Template example: Single Selection enabled

Allowed Groups setting

Choose which category groups your field can select from, or let it select from all groups.

Requirements

Category Groups Field requires Craft CMS 4.5.0 or later.

Installation

Category Groups Field can be installed from the Craft Plugin Store or with Composer.

Craft Plugin Store

Open your project's control panel, navigate to the Plugin Store, search for Category Groups Field and click Install.

Composer

Open your terminal, navigate to your project's root directory and run the following command:

Then open your project's control panel, navigate to Settings → Plugins, find Category Groups Field and click Install.

Support

If you find a problem with Category Groups Field, please let me know by opening an issue on GitHub.


All versions of craft-category-groups-field with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^4.5.0
php Version ^8.0.2
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 ttempleton/craft-category-groups-field contains the following files

Loading the files please wait ....