Craft 5 Plugin Update

Verbb Team Verbb Team Mar 2024 6 min read

In case you haven't heard, Craft 5 (opens new window) is right around the corner! After an exciting dev preview announced at Dot All 2023 (opens new window), Craft 5 has reached beta status with a whole lot of exciting changes.

We won't recap the features here (go on, have a read (opens new window)), but what does this mean for the Verbb plugins?

Well, gather 'round and let's discuss.

Go get 'em#

Firstly, almost all of our plugins are available right now for the Craft 5 beta Plugin Store (opens new window), so if you're keen to dive right in, go for it! The only ones not ready are:

Most plugins are a straight compatibility update with no new features or breaking changes. However, as each plugin has received a major version bump, we've taken the opportunity to roll in some breaking changes or new features for some plugins.

Events#

Events will be receiving some major architectural changes including repeatable events, sessions and a revamped UI. Check out the full list of features (opens new window) we're working on.

We're currently working on these major changes, and aren't yet available - but Events is available right now as-is and works on Craft/Commerce 5.

Formie#

Craft 5 introduced several behind-the-scenes changes to how fields work with the new content organisation changes. This gave us pause for thought on our current implementation of how fields and content are managed within Formie.

Content Tables#

Firstly, we're taking Craft's lead and ditching individual content tables for submissions. This is now being replaced with a single JSON column in your formie_submissions database table. This not only means better performance for submissions but addresses a long-standing issue of being limited to a certain number of fields in a form. With this change, we're very pleased to announce your forms can now contain an unlimited number of fields. First to show us a form with 5,000 fields gets a prize.

Repeater & Group Fields#

Continuing with the theme of performance, we've revamped Repeater and Group fields. Previously, these were functionality the same as a Super Table and Static Super Table field respectively. These honestly were a resource drain with multiple elements (an element for each "row" in a Repeater), and also meant dealing with these fields and their content was needlessly complex. So - these fields still work the same, but their underlying structure is now a simple array, ditching the complexities of elements.

Fields#

The biggest change is the restructuring of fields and field layouts. Previously, we extended a lot of functionality from Craft with regard to fields and field layouts. While initially very useful to abstract some behaviour away, it's caused us a few headaches. Particularly if Craft changes something about a field in Craft, Formie has to deal with the repercussions of that. Or, because Craft's fields are very control-panel driven, there are plenty of features that just aren't used by Formie fields. This is exactly what's happened with Craft 5's field changes, but has bitten us in the past with minor Craft updates breaking Formie forms.

Similarly, field layouts are purpose-driven for the control panel with tab/field relationships. In Formie, there's a page/row/field relationship which we've tried to make work with Craft's own field layouts to keep it compatible with things.

Not to mention, Formie fields are stored alongside regular fields, despite being for a different purpose, Craft was doing potentially a lot more work initializing Formie fields when it didn't need to. So there are definite performance benefits to our own solution.

As Formie hits its adolescent stage, we're branching out and doing things on our own terms! Formie now stores layouts, pages, rows and fields in its own database tables, with its own classes and logic, separate from Craft. This gives us a lot more control over these respective APIs, and means fields/etc can stay lean and purpose-built for Formie's needs without having to undo any of the things Craft fields were designed for. It's also paving the way for larger features we have planned (hint: Quizzes and Surveys).

But importantly, we've strived to keep things backwards-compatible, and we'll always take Craft's lead on designing APIs for interacting with fields to keep things familiar across the board with Craft and Formie for developers who want to deep-dive.

OAuth#

OAuth-based integrations now use the Auth Module to handle authentication under the hood. This greatly simplifies our codebase and doesn't reinvent the wheel for something like connecting to a third-party provider.

Formie takes care of migrating you over to the Auth Module so you shouldn't notice any change in behaviour unless you've implemented your own custom integration that uses OAuth.

Wrap up#

Most of these changes are behind-the-scenes changes that shouldn't affect end users. We've also strived to keep things backward-compatible and deprecated methods to ease the transition to Formie 3. The people most affected by these changes will be those who have created custom fields or custom integrations.

Oh, and don't forget to check out what else we have planned (opens new window) for Formie 3.

These new features are available right now for Formie for Craft 5 (opens new window).

Super Table#

Stop the presses folks, the moment is finally here. Super Table is now, officially done.

Craft 5 has (finally omg) brought nested Matrix fields into reality, and we couldn't be happier! That's probably the biggest feature request for Craft, ever — and something that Super Table has helped out with.

They've also introduced a neat new table-style interface with inline editing similar to Super Table. While it's not visually a 1-for-1 with Super Table, that's always been only half of the goal for the plugin. But with more effort being given to this sort of content authoring, we'd much rather steer progress towards a native solution than a third-party plugin. If more people care about it, then the Craft team will make it happen. And that's always been Super Table's reason for staying free — it was always going to be retired one day.

And hey, Neo (opens new window) isn't going anywhere.

The migration path for Super Table is that it's still available for Craft 5, but it will convert all your Super Table fields, and Super Table blocks to Matrix fields and Entries respectively. At this point, you could uninstall Super Table and continue managing content with nested Matrix fields.

It's incredibly bittersweet to say goodbye to Super Table, and we're so proud of this little free plugin that's been the default install on so many projects. But as they say, if you love something, you've got to let it go.

You'll always be in our hearts Super Table 😢

Wishlist#

We wanted to give the Wishlist plugin a revamp and make things a bit more Craft-friendly.

For the older folks in the audience, Wishlist was based on the Shortlist (opens new window) plugin for Craft 2, which was itself ported from Expression Engine (opens new window). Unfortunately, the APIs for interacting with lists and list items were sometimes confusing.

For example, compare managing items in v2 vs v3.

{# Wishlist v2 #}
{% set item = craft.wishlist.item(entry.id) %}
<a href="{{ item.addUrl() }}">Add to List</a>

{# Wishlist v3 #}
<a href="{{ craft.wishlist.addItemUrl(entry) }}">Add to List</a>

Where if you want to add/remove/toggle an item in your wishlist, you'd need to call craft.wishlist.item first.

There's also a clearer method of getting the list for the current user so it's clearer to developers.

{# Wishlist v2 #}
{% set list = craft.wishlist.lists().default(true).one() %}

{% if list %}
    <ul>
        {% for item in list.items.all() %}
            <li>{{ item.title }}</li>
        {% endfor %}
    </ul>
{% endif %}

{# Wishlist v3 #}
{% set list = craft.wishlist.getUserList() %}

<ul>
    {% for item in list.getItems() %}
        <li>{{ item.title }}</li>
    {% endfor %}
</ul>

These new features are available right now for Wishlist for Craft 5 (opens new window).

Signing off#

Until next time, have fun with Craft 5!