Skip to content

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.

  1. Scaffold a collection blueprint

    Run make:entry from your project root to generate site/entries/collections/seasons.yaml:

    Terminal window
    php vendor/bin/wire make:entry seasons --kind=collection
  2. Define your fields

    Open site/entries/collections/seasons.yaml and replace its contents with a practical schema:

    site/entries/collections/seasons.yaml
    title: Charter Seasons
    kind: collection
    icon: calendar
    labelField: title
    columns: [title, code, rate_multiplier, is_peak]
    filters: [is_peak]
    sort: sort
    unique: code
    publishable: true
    revisions: 10
    fields:
    title:
    type: text
    label: Season Name
    required: true
    index: true
    columnWidth: 50
    code:
    type: text
    label: Season Code
    required: true
    index: true
    pattern: '/^[A-Z0-9_-]{2,16}$/'
    columnWidth: 25
    rate_multiplier:
    type: float
    label: Rate Multiplier
    default: 1.0
    min: 0.1
    max: 10.0
    index: true
    columnWidth: 25
    is_peak:
    type: toggle
    label: Peak Season
    index: true
    columnWidth: 50
  3. Create a record

    You can add your first record from the Admin UI or through PHP.

    1. Open Setup -> Entries -> Collections -> Charter Seasons.
    2. Click Add Charter Seasons.
    3. Enter High Season (July - August) for Season Name, HIGH_2026 for Season Code, 1.45 for Rate Multiplier, and toggle Peak Season on.
    4. Click Save.
  4. 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
    <?php
    declare(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>';
    }

Next steps