visiosoft/style_selector-module
Style Selector module for Visiosoft's Streams-based Laravel CMS. Adds a field type and admin UI for picking from predefined style options, letting editors apply consistent presentation choices to entries without editing templates or code.
This is an OpenClassify/PyroCMS-style addon module that adds a "style selector" UI for switching site style presets — it is not a standalone Laravel package. You cannot meaningfully install it into a plain Laravel app; it expects the Streams Platform (addon registry, addon:install, modules folder layout) to be present.
Minimal steps inside an OpenClassify project:
composer.json (it is unlikely to be on Packagist under a stable tag given the release history):
composer config repositories.style-selector vcs https://github.com/openclassify/style_selector-module
composer require openclassify/style_selector-module:dev-main
php artisan addon:install visiosoft.module.style_selector
(Alternatively, enable it from the admin Addons screen — the module's {Name}Module.php class declares its slug/namespace, so the installer needs that file present.)php artisan optimize:clear if the admin menu entry does not appear.Where to look first: open src/StyleSelectorModuleServiceProvider.php and src/StyleSelectorModule.php — that is where the routes, bindings and menu hooks live. Then look in src/Resources/ for config/, views/ and lang/. The actual list of style presets is almost certainly a config array or a section in the module's Resources/config/; that file is the single most useful thing to read before touching anything.
First use case: boot an OpenClassify instance, log into the admin, navigate to the module's section (usually under Settings or Addons), and toggle the active style. You are essentially validating that the module's routes load and that its view partials render inside the active theme — most integration problems show up at this step.
Treat this as an admin-side theme switcher, not a front-end component library. If your requirement isn't "let an operator flip a predefined style preset in an OpenClassify install," the module is the wrong tool and a small settings panel of your own will be easier.
Wiring a new style preset. The module's selector renders whatever options are declared in its config/lang files. To add a preset, edit the config array (or the lang/{locale}/addon.php labels) and point each option at a theme/css asset that already exists in your active theme. Because the module was last released in 2022, avoid relying on any documented schema — read the view that renders the radio/select to see exactly which keys it expects:
// src/Resources/config/settings.php (illustrative — verify against the source)
'styles' => [
'default' => ['label' => 'Default', 'css' => 'theme::css/styles/default.css'],
'compact' => ['label' => 'Compact', 'css' => 'theme::css/styles/compact.css'],
],
Persisting the choice. OpenClassify/PyroCMS modules of this age typically store the selection via the Settings/Preferences API (Streams Settings repository or setting() helper), keyed by a namespaced slug like visiosoft.module.style_selector::style. Use that key in your own code rather than inventing a new one:
$style = setting('visiosoft.module.style_selector::style', 'default');
If the module instead stores it on the user or site record, mirror that — do not double-store. Check the controller's post/save action to confirm the storage mechanism before writing dependent code.
Integrating in the theme. The usual pattern is a Blade include in the theme layout that pulls the active preset's asset:
@include('visiosoft.module.style_selector::partials.style', ['style' => $style])
Or, in the theme's service provider, push the stylesheet conditionally. Because the module ships its own views under Resources/views/, publish/override rather than editing vendor files if you need to customise markup.
Admin-facing workflow. If the module exposes a settings form, extend it by adding fields to the module's settings definition (Streams form fields) rather than building a parallel page. The admin form is the natural extension point; custom routes on top of a 2022-era PyroCMS module tend to break across OpenClassify upgrades.
Route naming. Routes are typically registered as visiosoft.module.style_selector::admin.styles.index etc. Use the full route name in links so the selector keeps working regardless of which admin namespace you're in.
composer.json and vendor-lock it — a dev-main constraint against a low-activity repo is asking for a broken build on a fresh composer update.Route method) traces back to the module being loaded outside a Streams-enabled app. Verify the platform version in composer.json before debugging the module itself.php artisan addon:reinstall visiosoft.module.style_selector
php artisan cache:clear
php artisan view:clear
The most common "my change did nothing" is a stale addon manifest cache, not a code bug.StyleSelector facade or model exists). Grep the src/ tree for setting(, ->route, and class.*Controller to build your own mental model — it will take ten minutes and save hours.setting($key) ?? config_default) anywhere you read the value.assets/ or public/ folder and a publishes() call in the service provider. If it isn't there, you'll need to copy the CSS/JS to public/vendor/... yourself and update any hard-coded paths in the module's views.addons/ directory, strip it to the settings key + a Blade partial, and own it — that eliminates the upgrade risk entirely while preserving the operator workflow.Overall: a tiny, unmaintained, single-purpose admin addon that is fine as a starting point inside an OpenClassify project and a liability as a versioned dependency. Read the source (it is small), pin the commit, and be prepared to fork.
How can I help you explore Laravel packages today?