Skip to content

ArtCodeStudio/wn-pages-compat-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winter.Pages Compatibility Shim — JumpLink.PagesCompat

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.

The problem

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.

What it does

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.

Installation

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:up

Installs 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 --relative

Meant to be installed alongside winter/wn-pages-plugin. On its own it does nothing.

License

MIT © Art+Code Studio

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages