Skip to content

Spoon plugin for Craft CMS - Enhance your Matrix fields with groups, tabs and more!

License

Notifications You must be signed in to change notification settings

zaengle/craft-spoon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plugin icon

Spoon plugin for Craft CMS

Bend your Matrix fields with block groups & tabs.


Use Spoon to group Matrix blocks, hide blocks and / or fields, and organise your block layouts with tabs.

Spoon never touches your content, it is simply a layer on top of the core Matrix field type, so if you ever don’t want it you can just take the blue pill and uninstall it.

Or is it the red pill. Which is the real illusion?!

Now works with Super Table!

Get inception heavy with either a Matrix inside a Super Table or go wild and nest that Super Table in another Matrix for more fun.


How to Install the Plugin

Installation via Plugin Store

To install the Spoon plugin via the plugin store, follow these steps:

  1. In your site's control panel, visit the Plugin Store page. If you do not see a link to the Plugin Store, be sure you are working in an environment which allows admin changes.

  2. Search for "Spoon".

  3. Install the plugin titled Spoon.

Installation via Console Commands

To install the Spoon plugin via the console, follow these steps:

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to load the plugin:
composer require doublesecretagency/craft-spoon
  1. Then tell Craft to install the plugin:
./craft plugin/install spoon

Alternatively, you can visit the Settings > Plugins page to finish the installation.


Overview

Organise long lists of blocks into smaller groups for clearer selection.

block type groups example

Arrange fields into tabbed groups on each block type.

block type field layouts example

Use just one Matrix field and hide and show blocks or fields based on the Entry Type, Category Group and more.

group block types button

Usage

The way Spoon works is by allowing you to create your block type groups and field layouts in multiple contexts.

Say you have a large Matrix field that drives a lot of the content on your site, you want it to work the same way across most of the control panel but there are often a couple of places you just want to tweak it. You might want an extra block type for a specific section, or to not show certain fields somewhere as they aren’t applicable in that context.

We enable this to happen by making use of contexts. Each time the code runs that manipulates the output of your Matrix fields we check the context of the page to see if there is any specific configuration for that context and if not fall back to any defaults you may have set.

The following contexts are currently supported:

  • Entry Types
  • Category Groups
  • Global Sets
  • Users

You can override your defaults for a specific context by going to the field layout designer for each one, clicking the gear icon of any active Matrix field and selecting “Group block types”:

group block types button

Setting up defaults

To create default block type groups and field layouts for all your Matrix fields go to Spoon in the main navigation. Here you will find a list of your current Matrix fields.

Click a field name to launch the block type groups editor. It should look something like this:

block type groups editor

Now you can group your block types in the same way that you create a field layout for a section:

block type groups editor filled in

If you leave any block types off then they won’t be shown.

Once you have some groups you can go one step further and customize the field layout for a particular block - just click the gear icon and select ‘Edit field layout’.

block type field layout

Thats it! You should now be able to browse to somewhere that uses that field and see your new groups and field layouts in action.

Config settings

Spoon supports the standard config.php multi-environment friendly config file for the plugin settings. Just copy the config.php to your Craft config/ directory as spoon.php and you can configure the settings in a multi-environment friendly way.

  • nestedSettings - set this to an array of Matrix field handles that should use the nested settings menu display mode:

nested settings menu


Further Support

If you have any remaining questions, feel free to reach out to us (via Discord is preferred).

On behalf of Double Secret Agency, thanks for checking out our plugin! 🍺

Logo for Double Secret Agency

About

Spoon plugin for Craft CMS - Enhance your Matrix fields with groups, tabs and more!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 51.2%
  • JavaScript 31.7%
  • Twig 7.1%
  • Vue 5.2%
  • SCSS 4.8%