# va-themes/cleverphant

Cleverphant — content website theme for educational institutions.
Redesign base for cleverphant.lt (WordPress Bricks original).

## Status

Inactive by default. Activate via admin Themes UI or `php artisan db:seed --class=...ThemeSeeder`.

## Structure

- `src/Providers/ThemeServiceProvider.php` — extends BaseThemeServiceProvider
- `Resources/views/` — Blade overrides for Pages, News, NewsCategories modules
- `Resources/assets/` — Vite source (tokens, per-section CSS, per-component JS)
- `Routes/web.php` — theme-owned routes (contact form POST handler)
- `Database/Seeders/CleverphantThemeSeeder.php` — DB row seeder
- `theme.json` — admin themes:sync metadata
- `public/build/` — Vite build output (published to host via vendor:publish)

## Page content management

The 9 cleverphant pages are seeded via:

```bash
php artisan cleverphant:seed-pages              # firstOrCreate (default, preserves edits)
php artisan cleverphant:seed-pages --dry-run    # preview changes, touch nothing
php artisan cleverphant:seed-pages --force      # overwrite existing rows (asks to confirm)
```

If your host already had Protera-era pages with slugs `kontaktai`, `pristatymas`,
or `privatumo-politika`, the default seeder skips them (preserves admin edits).
Run `--force` once after install to replace them with cleverphant content. After
that the CKEditor admin UI is the single source of truth — `--force` is no longer
needed. Force is intentionally NOT wired into `cleverphant:activate` (activate is
non-destructive; force overwrites page bodies).

## Clean-slate install (foreign-content wipe)

`cleverphant:install` is **destructive by default** (task-34): it wipes every
non-Cleverphant web content row BEFORE seeding, so `/duk` + `/tinklarastis` show
only Cleverphant content. `--additive` opts out (keeps coexisting rows).

```bash
php artisan cleverphant:install                 # destructive: wipe foreign, seed cleverphant, activate
php artisan cleverphant:install --additive      # keep existing non-Cleverphant content
php artisan cleverphant:install --dry-run        # preview the wipe + seed plan
```

The wipe lives in `CleverphantContentWiper` and uses a **page-slug allowlist**
(keeps Cleverphant's own 10 pages, wipes the rest; News/FAQ wiped in full) — this
predates and differs from the theme-agnostic
`ViartasCore\Core\Support\ForeignCmsContentWiper` used by `florial:seed-content
--fresh` and `seglo:install --wipe-foreign`. Cleverphant keeps its allowlist
variant deliberately: its Pages seeder is `firstOrCreate`, so admin edits to
Cleverphant pages survive a re-install (a purge-then-reseed would drop them).

See `.claude/tasks/Cleverphant/README.md` for full implementation chain.
