How to customize backend authentication page of October CMS?

1.3k Views Asked by At

I'm trying to customize the backend of October CMS. I'm using a plugin called Backend Skin: it hallows to customize October backend recreating folder structure inside your theme. So the core is not touched.

I have succesfully load a new css that act on authorization page (auth.htm), but now I've need to edit the form html and I'm not able to customize this section, which is contained in signin.htm and loaded with function <?= Block::placeholder('body') ?> inside of auth.htm. Code below:

<div class="layout-row">
 <div class="layout-cell">
  <h1 class="oc-logo"><?= e(Backend\Models\BrandSetting::get('app_name')) ?></h1>
   <div class="outer-form-container">
     <?= Block::placeholder('body') ?>
   </div>
 </div>
</div>

Those function go on call the original signin.htm and not my signin.htm.

I have read the documentation of October, but I can't understand to manage this code: <?= Block::placeholder('body') ?>. How can I tell to October to load my new signin.htm located in themes/mytheme/backend/controllers/auth/signin.htm (same structure of original signin.htm located inside modules/backend/controllers/auth/)?

The plugin author says there's no need to change the path of files, since they are placed inside the same structure of original backend. But for singin.htm it doens't work.

I hoper you can give some feedback about this.

Thank you very much

1

There are 1 best solutions below

3
On

Yes you are almost right but you also need to make sure its inside module.

means for layouts it pick up direct path your_theme/backend/layouts/auth.htm

For module inner controller you need more specifications.

so your correct path for signin.htm should be like this

themes/mytheme/backend/views/modules/backend/controllers/auth/signin.htm

I guess author also mentioned it as well in docs https://octobercms.com/plugin/cyd293-backendskin

its little confusing but you will surly get idea

themes/mytheme/backend <= main folder as we put all overriding thing here

                      /views <= view files not layouts or assets

                             /modules <= yes modules 

                                     /backend <= yes backend module

                                             /controllers/auth/signin.htm
                                             // finally auth controller's signin.htm  

I guess this will make you understand how it works, now you are able to override that form html.

for some wired reason in my windows 10 machine path looks like this not sure why

your_theme\backend\views\ules\backend\controllers\auth\signin.htm
--------------------------^ this

Try this may be it will work.

if any doubt please comment.