Download the PHP package fostercommerce/entry-type-rules without Composer

On this page you can find all versions of the php package fostercommerce/entry-type-rules. 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 entry-type-rules

Entry Type Rules plugin for Craft CMS 5

A Craft plugin that allows you to set rules on number of entry types in a Craft section and/or limit who can include entry type entries based on their user group.

Requirements

This plugin requires Craft CMS 5.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
  2. Then tell Composer to load the plugin:

    composer require fostercommerce/entry-type-rules
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Entry Type Rules.

Entry Type Rules Overview

Entry Type Rules will allow you to restrict entry types in sections based on a count limit and/or user group. This can be useful when taking advantage of entry types for example in a structure section, where you could have a "Contact" entry type that you only want one of within a "Pages" structure section, or a "Blog Landing Page" entry type you would only like to allow certain users to be able to create.

For example, if an entry type in a section has a count limit set, and the number of entries for that entry type has been reached, when creating a new entry, the Entry Type selector field will have that entry type disabled. Likewise, if an entry type has been restricted to allow for only certain user groups to create new ones, and the current user is not in those user groups, the entry type option will also be disabled for that entry type.

Configuring Entry Type Rules

Entry Type Rules can be configured from its Settings page in the control panel or, by using a config file which will override the plugins settings from those set in the control panel settings page.

Configure in the Control Panel Settings Page

In the Control Panel, go to Settings → Entry Type Rules. The control panel settings page lists out all of your structure and channel sections, and their entry types. For each entry type you can place a numerical limit on the number of entries, and/or select the users groups which can create new entries of the entry type.

Limit Fields

The limit field allows you to set an entry limit for the entry type. Once the number of entries has reached that limit, the entry types option will be disabled in the entry edit form. If you set the limit to a number below the current number of entries of that entry type, a warning will be displayed. NOTE: The setting will still be saved regardless of the warning, its just there to inform you.

User Groups Fields

The user groups field allows you to select the user groups that can create new entries of the entry type. If a user is not in any of the specified groups, the entry types option will be disabled in the entry edit form. NOTE: Admin users are never restricted from adding entries

Configure using a Config File

To configure the plugin via a config file:

  1. Copy the config.php file from the vendor/fostercommerce/entry-type-rules directory to Craft's config/ directory
  2. Rename it to entry-type-rules.php
  3. Edit the sections array in that file to set the sections, entry types, limits, and user groups settings.

  4. In the sections array you include the section handles for each section.
  5. Within those sections you include the entry type handles for each entry type you want to create rules for.
  6. Within the entry types you can then include rules for :
    • limit - A numeric limit for the number of entries of that entry type
    • userGroups - An array of user group handles to limit who can create new entries of that entry type

Entry Type Rules Roadmap

The following is a list of additional features we are working on to incorporate into Entry Type Rules:

Credits

Brought to you by Foster Commerce


All versions of entry-type-rules with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^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 fostercommerce/entry-type-rules contains the following files

Loading the files please wait ....