A tiny Winter CMS plugin that lets you migrate from
RainLab.Pages to the official
winter/wn-pages-plugin without
breaking third-party plugins that still hard-reference the old RainLab\Pages\*
namespace.
Winter's Pages fork renames the namespace RainLab\Pages\* → Winter\Pages\*.
Static-page content lives in theme files and keeps working, but plugins that
reference the RainLab classes directly break. A common example is
Renatio.SeoManager, whose SeoStaticPage extends static-page edit forms via:
protected $pageType = \RainLab\Pages\Classes\Page::class;
// ...
if (!$widget->model instanceof $this->pageType) {
return; // -> SEO fields silently stop being attached
}Once RainLab.Pages is removed, RainLab\Pages\Classes\Page no longer exists, so the
instanceof never matches and the SEO tab disappears from static pages.
On boot() it registers a lightweight autoloader that lazily aliases any
requested RainLab\Pages\Classes\<Name> onto the matching
Winter\Pages\Classes\<Name> — but only when the Winter class exists and the legacy
name isn't already defined:
- No-op while RainLab.Pages is still installed (the real classes win).
- No-op before Winter.Pages is installed (no alias target).
- After the swap, legacy references resolve transparently, with zero eager cost (the alias is created the first time a legacy class name is referenced).
The whole plugin is a handful of lines in Plugin.php.
Not on Packagist — install from this repository:
composer config repositories.wn-pages-compat vcs https://github.com/ArtCodeStudio/wn-pages-compat-plugin
composer require jumplink/wn-pages-compat-plugin
php artisan winter:upInstalls to plugins/jumplink/pagescompat. No migrations, no settings.
If your site is served from a mirrored public/ folder, refresh the symlinks:
php artisan winter:mirror public --relativeMeant to be installed alongside
winter/wn-pages-plugin. On its own it does nothing.
MIT © Art+Code Studio