How to set up custom error pages
Created 8 years ago by rickkuk

Need instruction, specifically for 404...

hugogilmar  —  8 years ago Best Answer

I deal with that this way,

  1. Create a custom theme.
  2. Create custom error twig templates.
  3. Registrer error pages in theme service provider.
    protected $overrides = [
        'streams::errors/404' => 'theme::errors/404',
        'streams::errors/500' => 'theme::errors/500'
    ];

Hope this helps.

hugogilmar  —  8 years ago

Hi,

Are you working with a custom theme(generated with make:addon)?

hugogilmar  —  8 years ago Best Answer

I deal with that this way,

  1. Create a custom theme.
  2. Create custom error twig templates.
  3. Registrer error pages in theme service provider.
    protected $overrides = [
        'streams::errors/404' => 'theme::errors/404',
        'streams::errors/500' => 'theme::errors/500'
    ];

Hope this helps.

ryanthompson  —  8 years ago

View's delegate the error output when not in debug mode so you can simply override those: https://github.com/pyrocms/starter-theme/blob/master/src/StarterThemeServiceProvider.php#L20

rickkuk  —  8 years ago

Thanks guys, that worked!

ryanthompson  —  8 years ago

@rickkuk don't forget to mark answered as to signal others looking 😊