No, as far as I know you can Yootheme Pro only create one 404 Error Page that fits the whole Page without showing anything else from your site.
What I usually do to have an Error Page with Site Elements (Header, Top Menu and Footer), is to create an Error Article, hidden Menu Item and use my own error.php File. The error.php redirects faulty traffic to that Article/Menu Item.
Steps to create a 404 Error Page in a Web Site with Yootheme Pro that shows your Header, Top Menu and Footer:
- Create a "Sorry, we can not find that page" Article.
- Create a Menu Item of type Single Article and choose that Article.
- Set the Alias to 'error' and hide the Menu Item (under "Link Type", choose "Display in Menu": No).
- Check if the Error Page is displayed at https://example.com/error (but with a HTTP 200 Success).
- Create an error.php file that redirects faulty traffic to your Error Page and force a "404 Not Found" Status Code. Put that File in a Yootheme Child Theme Folder:
/templates/yootheme_some-child-theme-name/error.php
.
- In Yootheme configure "some-child-theme-name" as Child Theme.
- Put the following code in your
/templates/yootheme_some-child-theme-name/error.php
.
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Uri\Uri;
if ($this->error->getCode() == '404')
{
header("HTTP/1.0 404 Not Found");
echo file_get_contents(URI::root() . '/error');
exit;
}