Download the PHP package bymayo/curated without Composer

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

Curated for Craft CMS 5

Craft can show you related elements, but can't reorder them when the relation lives on the other side.

Curated fixes that. The field auto-populates from existing relations β€” add a Product to your T-shirts category and it appears in T-shirts' Curated field, ready to drag into place. The same Product can sit at #1 in T-shirts and #9 in Sale, each category with its own independent order. Works with Entries, Categories, Assets, Users, and (with Craft Commerce) Products and Variants.

🎬  Watch the video walkthrough β†’

See Curated in action in under a few minutes.

Perfect for…

Features

How Curated compares

Curated is about ordering, not establishing or proxying the relation itself.

Capability Craft's native relation fields Many to Many Reverse Relations Curated
Drag-reorder per source ❌ shared sortOrder ❌ uses native ❌ uses native βœ…
Same target at different positions in different sources ❌ ❌ ❌ βœ…
Show relations created from the other side ❌ βœ… one configured field βœ… one configured field βœ… any field, either direction
Field's picker writes a native relation βœ… βœ… proxies varies ❌ ordering only
Per-site ordering ❌ inherits native inherits native βœ…
Auto-includes new relations created elsewhere ❌ ❌ ❌ βœ…
Quick reorder actions (Move to top / bottom / position) ❌ ❌ ❌ βœ…
Pin / Unpin items to the top of a source ❌ ❌ ❌ βœ…
Inline "Sort by…" reorder (title / date / random / price) ❌ ❌ ❌ βœ…
Default Placement for new relations ❌ ❌ ❌ βœ…
GraphQL support βœ… ❌ ❌ βœ…

Different jobs. Many to Many and Reverse Relations edit the inverse side of one specific relation field. Curated orders whatever's already related (any direction, any field).

Install

Enable in Settings > Plugins, or install via the Plugin Store.

Requirements

Setup

  1. Create a Curated field. Give it a handle (e.g. curatedProducts), pick the Element type (Entry, Category, Asset, User, Commerce Product / Variant), optionally restrict Sources, then add it to the field layout of the source element (e.g. a Category).
  2. Open the source. The field is pre-populated with every matching element already natively related to it. Drag to reorder; save.
  3. Read on the front end via your field handle. The examples below assume the handle is curatedProducts:

Chain any normal query method:

Query from the other side

The second argument is the handle of the Curated field on the source. Returns empty if the field doesn't exist on that layout.

GraphQL

Curated fields surface on their host element with the standard element argument set for the target type (limit, offset, status, search, orderBy, etc.). The resolver returns the saved curated order, then applies any arguments you pass.

Mutations accept an array of element IDs in the desired curated order:

How Curated works

Curated queries every native relation between this source and elements of the target type, in either direction:

Both surface in the Curated field. The displayed list is [saved curated order] + [native relations not yet curated]. Default Placement controls where new natives land.

Sync utility

Go to Utilities β†’ Curated Sync in the CP and click Sync now.

You don't need this for Curated fields to work, they populate themselves. Run it when you want to save the current order in one go, for example after importing a batch of entries or migrating content between environments. It's safe to re-run, nothing gets duplicated.

Console command

Same as the Sync utility, just from the terminal. Handy after a deploy, or from a script.

Supported element types

Element type Common use case
Entry "Related articles", "Editor's picks"
Category Sub-categories under a parent
Asset Gallery / lookbook order
User Featured authors, staff order
Commerce Product Drag products inside a category
Commerce Variant Variant display order

Craft Commerce is required for Commerce Product and Variant types.

Warnings

  1. Curated sits alongside native relations. Keep the canonical relation where Craft expects it; use Curated on the source for order.
  2. Removing an item is soft by default. It drops out of the saved curated order, but reappears at the end on next render because the native relation still exists. To remove for good, also remove the native relation. Or enable the Fully remove on delete plugin setting below.
  3. Fully remove on delete (plugin setting) is destructive. When on, removing an item from a Curated field also deletes every native relation row between the two elements, in both directions, across any relation field. There's no undo. Editors removing items here will silently edit the canonical relation elsewhere in Craft, not just this field. Off by default for a reason.
  4. Curated writes content, not Project Config. Field settings sync via project config; the curated order itself lives in curated_relations and won't sync between environments.
  5. Large lists. The drag UI is good for hundreds of items, not tens of thousands. See the max_input_vars note below if you expect 1000+ items per field.

When an element is deleted entirely, it's removed from every curated list automatically.

max_input_vars and big lists

PHP's max_input_vars (default 1000) caps how many form inputs a request can have. Craft's element picker emits one input per item, so lists over ~1000 items will silently lose items on save unless you raise the limit:

Support

If you have any issues then I'll aim to reply as soon as possible. If it's a site-breaking-oh-no-what-has-happened moment, hit me up on the Craft CMS Discord, @bymayo


All versions of curated with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
craftcms/cms Version ^5.7.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 bymayo/curated contains the following files

Loading the files please wait ...