- Details
- Written by: Mr Alexandre J-S William ELISĂ
- Category: Uncategorised
-
Also available:
- Hits: 6
5 Steps to make your Joomla website remarquable even in case of failure...Interested? Let's dive in.
Step 1
Go to [joomla_root]/templates/system
Step 2
Copy fatal-error.php to fatal-error.custom.php
Step 3
IMPORTANT!!! Comment out the code that requires fatal-error.custom.php in the fatal-error.custom.php file to prevent infinite loop causing memory exhaution.
Step 4
In the fatal-error.custom.php add exactly this code
<?php
declare(strict_types=1);
/**
* @package Joomla.Site
* @subpackage Template.system
*
* @copyright (C) 2020 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
/**
* Note: This file is only used when unrecoverable errors happen,
* normally at boot up stages, and therefore it cannot be assumed
* that any part of Joomla is available (Eg: a Factory or application)
*
* For "normal" error handling, use error.php not this file.
*
* @var HtmlErrorRenderer $this object containing charset
* @var string $statusText exception error message
* @var string $statusCode exception error code
*/
// Fallback template
$template = '{{statusCode_statusText}}';
// User supplied fatal error page
if (file_exists(__DIR__ . '/fatal-error.custom.html')) {
$template = file_get_contents(__DIR__ . '/fatal-error.custom.html');
}
echo str_replace(
['{{statusCode_statusText}}', '{{statusCode}}', '{{statusText}}'],
[$statusCode . ' - ' . $statusText, $statusCode, $statusText],
$template,
);
Step 5
Final step, create a file called fatal-error.custom.html in the same folder than the previous files and put your simplified lightweight marketing content in it. It will show up instead of the red fatal error page of Joomla core
That's it 5 steps to make your Joomla site remarquable even in case of failure.
- Details
- Written by: Api Adept
- Category: Uncategorised
-
Also available:
- Hits: 2