How to override OctoberCMS backend layouts?
Ad
Is it possible to override backend layouts? For example the backend main menu (/modules/backend/layouts/_mainmenu.htm)
Ad
Answer
Ad
And of course the solution comes to me after asking the qustion. So here it is.
By default you can only change the skin that is used for the backend. So to extend it you first need to create a new class that extends the default backend skin information file (/modules/backend/skins/Standard.php)
<?php namespace Author\Plugin\Classes;
use Backend\Skins\Standard;
/**
* Modified backend skin information file.
*
* This is modified to include an additional path to override the default layouts.
*
*/
class BackendSkin extends Standard
{
/**
* {@inheritDoc}
*/
public function getLayoutPaths()
{
return [
base_path() . '/plugins/author/plugin/skin/layouts',
$this->skinPath . '/layouts'
];
}
}
And now you can just copy the existing layouts to that folder and modify them as you please.
Ad
source: stackoverflow.com
Related Questions
Ad
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page
Ad