Sidepipe for Craft CMS

Configuration

Settings → Plugins → Sidepipe, or a config/sidepipe.php file.

Every setting has a working default. A site that only ever uses the Sidebar layout element never needs to open this screen.

Settings

tabNames

Array of strings. Default ['Sidebar'].

Tab names that pipe their whole contents with no marker. Matched against both the tab's raw name and its site-translated name, ignoring case and collapsing whitespace — so Sidebar, sidebar and SIDE BAR are three different names but the first two are the same one.

Empty the list to turn name matching off entirely and require a marker everywhere.

defaultPosition

'top' or 'bottom'. Default 'top'.

Where a group sits relative to the element's own author, dates, slug and status, when the marker doesn't say. Name-matched tabs always use this.

showTabNameHeadings

Boolean. Default false.

Whether a name-matched tab renders its own name as a heading above its fields. Off, because a tab called "Sidebar" labelled "Sidebar" tells an author nothing. Turn it on if your tabNames list has names worth showing.

A Sidebar marker sets its own heading and ignores this.

respectFieldWidths

Boolean. Default false.

Field layouts hand out widths in quarters. In a 240px column, 25% is about sixty pixels, so piped fields are rendered full width by default. Turn this on to keep whatever width the layout gave them.

excludedElementTypes

Array of element type classes. Default [].

An escape hatch. Sidepipe skips these element types entirely, whatever their field layouts say — useful if a plugin's own element editor turns out to do something unexpected with its sidebar.

Config file

config/sidepipe.php overrides the control panel, the same as any Craft plugin. Values set here are read-only in the CP.

<?php

return [
    'tabNames' => ['Sidebar', 'Meta', 'Publishing'],
    'defaultPosition' => 'top',
    'showTabNameHeadings' => true,
    'respectFieldWidths' => false,
    'excludedElementTypes' => [
        craft\elements\Asset::class,
    ],
];

Multi-environment works as usual:

<?php

return [
    '*' => [
        'tabNames' => ['Sidebar'],
    ],
    'dev' => [
        'tabNames' => ['Sidebar', 'Scratch'],
    ],
];

tabNames and excludedElementTypes are plain lists of strings in a config file. The control panel posts them as table rows and checkbox values and flattens them back before saving, so both shapes are accepted.

Where it's in use

The bottom of the settings screen lists every field layout that currently pipes something, with how many groups and how many fields, grouped by what owns the layout.

Layouts on screens with no sidebar — global sets, tag groups, the user profile — are flagged there rather than left to look broken.

Only the field layouts Craft itself owns are listed. Craft has no index of layouts by owner, so a layout belonging to a plugin (a Commerce product type, say) still works at runtime but is not counted on that screen.