5-Minute Quickstart
In this walkthrough, you will scaffold a seasons collection, customize its fields, create a record in the admin workspace, and display published seasons in a ProcessWire template.
-
Scaffold a collection blueprint
Run
make:entryfrom your project root to generatesite/entries/collections/seasons.yaml:Terminal window php vendor/bin/wire make:entry seasons --kind=collection -
Define your fields
Open
site/entries/collections/seasons.yamland replace its contents with a practical schema:site/entries/collections/seasons.yaml title: Charter Seasonskind: collectionicon: calendarlabelField: titlecolumns: [title, code, rate_multiplier, is_peak]filters: [is_peak]sort: sortunique: codepublishable: truerevisions: 10fields:title:type: textlabel: Season Namerequired: trueindex: truecolumnWidth: 50code:type: textlabel: Season Coderequired: trueindex: truepattern: '/^[A-Z0-9_-]{2,16}$/'columnWidth: 25rate_multiplier:type: floatlabel: Rate Multiplierdefault: 1.0min: 0.1max: 10.0index: truecolumnWidth: 25is_peak:type: togglelabel: Peak Seasonindex: truecolumnWidth: 50 -
Create a record
You can add your first record from the Admin UI or through PHP.
- Open Setup -> Entries -> Collections -> Charter Seasons.
- Click Add Charter Seasons.
- Enter
High Season (July - August)for Season Name,HIGH_2026for Season Code,1.45for Rate Multiplier, and toggle Peak Season on. - Click Save.
site/ready.php or one-off script <?phpdeclare(strict_types=1);namespace ProcessWire;$entries = wire()->entries;$season = $entries->create('seasons', ['title' => 'High Season (July - August)','code' => 'HIGH_2026','rate_multiplier' => 1.45,'is_peak' => true,]);$entries->save($season); -
Display entries in a ProcessWire template
Query published seasons with
$entries->find()and enable output formatting (of(true)) before printing values to HTML:site/templates/home.php <?phpdeclare(strict_types=1);namespace ProcessWire;$seasons = wire()->entries->find('type=seasons, status=published, sort=-rate_multiplier, limit=10');if ($seasons->count() > 0) {echo '<ul class="season-list">';foreach ($seasons->of(true) as $season) {$title = $sanitizer->entities((string) $season->get('title'));$code = $sanitizer->entities((string) $season->get('code'));$multiplier = (float) $season->get('rate_multiplier');echo "<li><strong>{$title}</strong> ({$code}): {$multiplier}x</li>";}echo '</ul>';}